Advertisements

Aatul Palandurkar

Posts Tagged ‘Android Workshop

Objective :

  • Passing data between activities in Android
  • Passing multiple data between activities in Android
  • Passing array between activities in Android
  • Passing ArrayList between activities in Android
  • Passing ArrayList to another activity in Android
  • Sending data via Intent in Android
  • Sending multiple data via Intent in Android
  • Sending array between activities in Android
  • Sending ArrayList between activities in Android
  • Sending ArrayList to another activity in Android
  • Sending data via Intent and Bundle in Android
  • Sending multiple data via Intent and Bundle in Android
  • Passing array between activities in Android using Intent and Bundle
  • How to pass array to another activity in Android?
  • How to pass array between activities in Android?
  • How to pass data to another activity in Android?
  • How to pass data to activity in Android?
  • How to pass data to between activities in Android?
  • How to pass ArrayList to another activity in Android?
  • How to pass ArrayList between activities in Android?

 

Code for passing data between activities in Android :

ActivityOne.java


String value = "Hello!";
Intent in = new Intent(this,ActivityTwo.class);
in = putExtra("Key", value);
startActivity(in);

ActivityTwo.java


Bundle bundle = getIntent().getExtras();
String valueReceived = bundle .getString("Key");

 

Code for passing multiple data or values between activities in Android :

Method 1 : Using Intent to pass data and Bundle to extract data between activities in Android

ActivityOne.java


String value1 = "Hello!";
String value2 = "Hi!";
Intent in = new Intent(this,ActivityTwo.class); 
in = putExtra("Key1", value1); startActivity(in); 
in = putExtra("Key2", value2); startActivity(in); 

ActivityTwo.java

Bundle bundle = getIntent().getExtras();
String valueReceived1 = bundle .getString("Key1");
String valueReceived2 = bundle .getString("Key2");

 

Method 2 : Using Bundle to pass and to extract data between activities in Android

ActivityOne.java


String value1 = "Hello!";
String value2 = "Hi!";
Intent in = new Intent(this,ActivityTwo.class); 
Bundle bundle = new Bundle();
bundle.putString("Key1", value1);
bundle.putString("Key2", value2);
in = putExtras(bundle); 
startActivity(in); 

ActivityTwo.java

Bundle bundle = getIntent().getExtras();
String valueReceived1 = bundle .getString("Key1");
String valueReceived2 = bundle .getString("Key2");

 

Code for passing array between activities in Android :

ActivityOne.java

String[] array = new String[]{"Item1", "Item2", "item3", "Item4", "item5"};
Intent in = new Intent(this,ActivityTwo.class); 
Bundle bundle = new Bundle();
bundle.putStringArray("MyArray", array);
in = putExtras(bundle); 
startActivity(in); 

ActivityTwo.java

Bundle bundle = getIntent().getExtras();
String arrayReceived[] = bundle.getStringArray("MyArray");

 

Code for passing ArrayList between activities in Android :

ActivityOne.java

ArrayList<String> array = new ArrayList<String>();
array.add("Hello");
array.add("Hi");
array.add("Bye");
Intent intent = new Intent(this, ActivityTwo.class);
intent.putExtra("array_list", array);
startActivity(intent);

ActivityTwo.java

Bundle bundle = getIntent().getExtras();
ArrayList<String> array = (ArrayList<String>) bundle.getStringArrayList("array_list");

		
Advertisements
Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

IMG-20141224-WA0011

Conducted 5 Days Training on Android, HTML5 and WordPress at Tulsiramji Gaikwad Patil College of Engineering & Technology, Nagpur from 22nd Dec. 2014 to 26th Dec. 2014

It was Training cum Internship program for students and there were more than 250 students who attended this program. We have conducted 3 parallel sessions and it was again a good experience with the students of TGPCET, Nagpur.

Conducted 3 days Android Workshop at KITS College, Ramtek, Dist. Nagpur for Student of Information Technology from 23rd Aug. 2014 to 25th Aug. 2014. Again it was a good experience with students of KITS.

Conducted 3 days Android Workshop at KITS College, Ramtek, Dist. Nagpur for Student of Computer Technology from 20th Aug. 2014 to 22nd Aug. 2014. Again it was a good experience with students of KITS.

Conducted two days Android Workshop at M.H. Saboo Siddik College of Engineering, Byculla, Mumbai on 11th and 12th Aug 2014.

There were around 100 students who attended the workshop and get benefited out of it. Few staff member also attended the workshop.

The infrastructure of the college is very good and the seminar hall where we conducted workshop was also very good. The staff, coordinators and the student were also very good and keen to learn new technologies. I would love to visit the place again. I am very thankful to the coordinators who had assisted a lot during the training and for all the arrangements they have made for me.


Advertisements

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 8,346 other followers

Tweets

%d bloggers like this: