android - Get the current time when the user comes out of an item in a listview -
i have horizontal listview contains albums. want time when user opens , closes album. able time when album opened , don't know how can time when user comes listview.
here code,
listview1.setonitemclicklistener(new onitemclicklistener() { @override public void onitemclick(adapterview<?> parent, view v, int position, long arg3) { try { jsonobject = new arraylist<jsonobjectclass>(); jsonobjectclass jsondata = new jsonobjectclass(); string datetime = (string)getdatetime(); gps = new gpstracker(mainphotoalbumactivity.this); // check if gps enabled if(gps.cangetlocation()){ double latitude = gps.getlatitude(); double longitude = gps.getlongitude(); jsondata.lattitue = latitude; jsondata.longitude = longitude; jsondata.album_opened = datetime; jsondata.license_key = new homeactivity().lickey; toast.maketext(getapplicationcontext(), "your location - \nlat: " + latitude + "\nlong: " + longitude, toast.length_long).show(); }else{ // can't location // gps or network not enabled // ask user enable gps/network in settings gps.showsettingsalert(); } albumnameforcontent = thumbnails1.get(position).albumname .substring(thumbnails1.get(position).albumname .lastindexof("/") + 1); jsondata.album_name = albumnameforcontent; //code display each image in album.. } please let me know how can done.. :)
i found way time wen user closes album. implemented onbackpressed() in activity, when ever user clicks button (meaning s exiting album) take current time.
Comments
Post a Comment