Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CustomListing currentListing = new CustomListing();
- Intent i = new Intent();
- Bundle b = new Bundle();
- b.putParcelable(Constants.CUSTOM_LISTING, currentListing);
- i.putExtras(b);
- i.setClass(this, SearchDetailsActivity.class);
- startActivity(i);
- Bundle b = this.getIntent().getExtras();
- if (b != null)
- mCurrentListing = b.getParcelable(Constants.CUSTOM_LISTING);
- class Myclass {
- int a;
- class SubClass {
- int b;
- }
- }
- MyClass src = new MyClass();
- Gson gS = new Gson();
- String target = gS.toJson(src); // Converts the object to a JSON String
- Intent i = new Intent(FromActivity.this, ToActivity.class);
- i.putExtra("MyObjectAsString", target);
- String target = getIntent().getStringExtra("MyObjectAsString");
- MyClass src = gS.fromJson(target, MyClass.class); // Converts the JSON String to an Object
- public class PersonHelper
- {
- public static Person person;
- }
Add Comment
Please, Sign In to add comment