Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import android.content.Context;
- import android.content.Intent;
- import android.os.Bundle;
- import android.support.annotation.Nullable;
- import android.support.v7.app.AppCompatActivity;
- /**
- * Created by Sergey Prilutsky on 17.01.17.
- */
- public class SampleActivity extends AppCompatActivity {
- public void someMthod(){
- SomeFragment.getInstance(new Some2Callback());
- }
- @Override
- protected void onCreate(@Nullable Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- parseIntent();
- }
- private void parseIntent(){
- Bundle bundle = getIntent().getExtras();
- if(bundle!=null){
- }
- }
- public static final Intent getIntent(Context ctx){
- Intent intent = new Intent(ctx, SampleActivity.class);
- return intent;
- }
- public static final Intent getIntent(Context ctx, int para){
- Intent intent = new Intent(ctx, SampleActivity.class);
- return intent;
- }
- public interface SomeActivityCallback{
- public void onCLick();
- }
- private class Some2Callback implements SomeActivityCallback {
- @Override
- public void onCLick() {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement