Advertisement
Guest User

Untitled

a guest
Dec 18th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.18 KB | None | 0 0
  1. DEVO PASSARE QUESTO ARRAY IN UN ALTRA ACTIVITY MA NON VA
  2.  
  3. activity dove parte
  4.  
  5. final Button changeActivity = findViewById(R.id.changeActivity);
  6.         changeActivity.setOnClickListener(new View.OnClickListener() {
  7.             @Override
  8.             public void onClick(View v) {
  9.                 Intent i = new Intent(GalleryActivity.this, TestActivity.class);
  10.                 startActivity(i);
  11.  
  12.                 Bundle b = new Bundle();
  13.                 b.putBooleanArray("ciao", bwImageArray);
  14.                 Intent i2 = new Intent(GalleryActivity.this, TestActivity.class);
  15.                 i2.putExtras(b);
  16.             }
  17.         });
  18.  
  19. activity dove arriva
  20.  
  21. @Override
  22.     protected void onCreate(Bundle savedInstanceState) {
  23.         super.onCreate(savedInstanceState);
  24.         setContentView(R.layout.activity_test);
  25.  
  26.         Bundle b = this.getIntent().getExtras();
  27.         bwImageArray1 = b.getBooleanArray("ciao");
  28.  
  29.  
  30.         final Button testButton = findViewById(R.id.testArrayButton1);
  31.         testButton.setOnClickListener(new View.OnClickListener() {
  32.             public void onClick(View v) {
  33.                 testArray(bwImageArray1);
  34.             }
  35.         });
  36.  
  37.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement