android


how to pass images and texts of alist view from one activity to another through bundle?


strong text
How to pass Images and Texts through button click from one activity to another in list view?
String str;
imageView.buildDrawingCache();
Bitmap image= imageView.getDrawingCache();
Bundle extras = new Bundle();
extras.putParcelable("imagebitmap", image);
extras.putString("Text",str);
intent.putExtras(extras);
startActivity(intent);
Bundle extras = getIntent().getExtras();
Bitmap bmp = (Bitmap) extras.getParcelable("imagebitmap");
image.setImageBitmap(bmp );
Make DTO like;
public class MusicDTO implements Serializable{
#Expose
#SerializedName("Artist")
private String Artist;
#Expose
#SerializedName("Song")
private String Song;
#Expose
#SerializedName("Duration")
private String Duration;
#Expose
#SerializedName("Image")
private String Image;
}
Then make list which having datatype as this DTO. & add all data in that List.
After Making List create bundle;
Bundle bundle = new Bundle();
bundle.putSerializable("MusicList", (ArrayList) listMusicDTO);
In Fragment Pass bundle like;
fragmentObj.setArguments(bundle);
Or, In Activity like;
intent.putExtras(bundle);
In Another Fragment Get bundle like;
List<MusicDTO> musicDTOList = (ArrayList) getArguments().getSerializable("MusicList");
Or, In Another Activity;
Intent intent = this.getIntent();
Bundle bundle = intent.getExtras();
List<MusicDTO > musicDTOList =
(List<MusicDTO >)bundle.getSerializable("MusicList");
In your activity or fragment pass data in bundle like this
Bundle b = new Bundle();
b.putString("Key", "" + value);
b.putString("Key", "" + value);
Intent i_NewComment = new Intent(context, DestinationActivity.class);
i_NewComment.putExtras(b);
context.startActivity(i_NewComment);
In your another activity fetch data like this
Bundle b = getIntent().getExtras();
if (b != null && !b.isEmpty()) {
stud_Id = b.getString("key");
TeacherId = b.getString("key");
}

Related Links

Taking screenshot of videoview and other multiple view in one layout
Android: Search resource in default strings file
RecyclerView doesn't load XML
Adding Randomized markers in a radius around you [Google Maps]
Migrating to Cloud Endpoints Framework v2, iOS Client
Facebook, Twitter, Google login in Fragment
Passing selected ListFragment's row item details (Current Tab) to another ListFragment (Next Tab)
On generation of Error 404 in webview - not redirecting to desired page
DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here
Handling different flows with RxJava and Retrofit
Make a copy of a specific row using its serial in the same table in Sqlite without looping
How to display phone angle while on side “landscape” as 0.0 Degrees? [on hold]
Get reference to overflow icon View
Unable to implement pause functionality in cocos2dx
Webview input error [closed]
How to solve these errors: package com.android/molley does not exist & error: cannot find symbol class SetContentView [on hold]

Categories

HOME
phantom-dsl
search
oracle12c
jpa
checkstyle
string
c99
jmeter
apache-jena
jax-rs
numbers
toolbox
graphics
static-site
nsbundle
hugo
square
ado.net
jetty
pearson-correlation
opengl-3
google-schemas
pcl-crypto
google-chrome-app
filechannel
eip
atlassian
do-while
http-post
capistrano3
boost-icl
articulate-storyline
spring-async
href
named-entity-recognition
joptionpane
pchart
epsilon
short-url
highstock
tiki-wiki
surveymonkey
fat
amazon-quicksight
autodesk-designautomation
code-snippets
latitude-longitude
playframework-2.1
odroid
dcmtk
logback-groovy
rfc3339
monkey-testing
wcftestclient
configurationmanager
zenhub
video-conferencing
headless
trigger.io
reachability
cudd
custom-lists
i386
tooleap
swizzling
angular-ui-typeahead
bizagi
nullable
jnlua
libvlc
tfs-workitem
terracotta
qt5.2
django-urls
fuelcms
finalbuilder
avahi
google-refine
kubuntu
bcache
mass-assignment
android-cookiemanager
device-tree
angular-carousel
parallel-testing
ecslidingviewcontroller
c++builder-xe5
rolify
tlf
asdf
chart-director
twisted.web
vfs
veracity
josql
failing-tests
isa-swizzling
tournament
quotation-marks
dataform
mtu
non-clustered-index
drupal-fivestar
interprocess
wysiwym
todos
java1.4
httpcookie

Resources

Encrypt Message