Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1.  
  2. import android.content.Context;
  3. import android.content.Intent;
  4. import android.os.Bundle;
  5. import android.support.annotation.Nullable;
  6. import android.support.v7.app.AppCompatActivity;
  7.  
  8. /**
  9. * Created by Sergey Prilutsky on 17.01.17.
  10. */
  11.  
  12. public class SampleActivity extends AppCompatActivity {
  13.  
  14.  
  15. public void someMthod(){
  16. SomeFragment.getInstance(new Some2Callback());
  17. }
  18.  
  19. @Override
  20. protected void onCreate(@Nullable Bundle savedInstanceState) {
  21. super.onCreate(savedInstanceState);
  22. parseIntent();
  23. }
  24.  
  25. private void parseIntent(){
  26. Bundle bundle = getIntent().getExtras();
  27. if(bundle!=null){
  28.  
  29. }
  30. }
  31.  
  32. public static final Intent getIntent(Context ctx){
  33. Intent intent = new Intent(ctx, SampleActivity.class);
  34. return intent;
  35. }
  36.  
  37. public static final Intent getIntent(Context ctx, int para){
  38. Intent intent = new Intent(ctx, SampleActivity.class);
  39. return intent;
  40. }
  41.  
  42. public interface SomeActivityCallback{
  43. public void onCLick();
  44. }
  45.  
  46.  
  47. private class Some2Callback implements SomeActivityCallback {
  48.  
  49. @Override
  50. public void onCLick() {
  51.  
  52. }
  53. }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement