Skip to content

👨‍🏫 Crud example Android + SQLite + retrofit2 + recyclerview + listview

Notifications You must be signed in to change notification settings

haikelfazzani/full-android-crud-sqlite

Repository files navigation

Android + SQLite Crud

How to pass an object from activity to another

Acitvity 1


Intent myIntent = new Intent(MainActivty1.this, MainActivty2.class);
myIntent.putExtra("contact", Contact);
startActivity(myIntent);

or using GSON API

private Gson gson = new Gson(); Intent myIntent = new Intent(MainActivty1.this, MainActivty2.class); myIntent.putExtra("contact", gson.toJson(contact)); startActivity(myIntent);

Acitvity 2

myContact = (Contact) getIntent().getSerializableExtra("contact");

Contact myContact = gson.fromJson(getIntent().getStringExtra("contact"),Contact.class);

About

👨‍🏫 Crud example Android + SQLite + retrofit2 + recyclerview + listview

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages