[android-developers] Re: Back button problem in android
First, I think you are asking a user question. This is a developer forum. I would suggest looking for the android market help forum. http://www.google.com/support/forum/p/Android+Market/label?lid=1d903020a35e806ehl=en. Or contact the developer of the app. Also for the time being, developers design their apps in different ways. You may not be able to go back to your activity; but maybe should try accessing recent apps with your device and choose your app. Good luck Vance On Sep 14, 7:43 am, pramod shirsath shirsath.pra...@gmail.com wrote: when i click on androids back button it stops whole activitybut i want to come back to previous page..can anyone help me to solve this problem... -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Back button problem in android
its very simple , in back button only the finish(); is executed . It means that the existing activity is canceled . If that activity leads to the last GUI screen of you application then the application gets closed . Try to override it . On Wed, Sep 14, 2011 at 4:52 PM, Vance Turnewitsch betweenthehi...@gmail.com wrote: First, I think you are asking a user question. This is a developer forum. I would suggest looking for the android market help forum. http://www.google.com/support/forum/p/Android+Market/label?lid=1d903020a35e806ehl=en . Or contact the developer of the app. Also for the time being, developers design their apps in different ways. You may not be able to go back to your activity; but maybe should try accessing recent apps with your device and choose your app. Good luck Vance On Sep 14, 7:43 am, pramod shirsath shirsath.pra...@gmail.com wrote: when i click on androids back button it stops whole activitybut i want to come back to previous page..can anyone help me to solve this problem... -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- ThanksRegards Kaushik Pendurthi http://kaushikpendurthi.blogspot.com/ -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Back button problem in android
Overriding the Back key is usually a bad idea. Even though most users are not technical enough to understand what it means to call 'finish()' on an Activity, they do get used to what it means in practice: the Activity is removed from the Activity stack and 'destroyed'. Be VERY careful about going against this expectation. On Sep 14, 2:58 pm, kaushik p kaushiks...@gmail.com wrote: its very simple , in back button only the finish(); is executed . It means that the existing activity is canceled . If that activity leads to the last GUI screen of you application then the application gets closed . Try to override it . On Wed, Sep 14, 2011 at 4:52 PM, Vance Turnewitsch betweenthehi...@gmail.com wrote: First, I think you are asking a user question. This is a developer forum. I would suggest looking for the android market help forum. http://www.google.com/support/forum/p/Android+Market/label?lid=1d9030... . Or contact the developer of the app. Also for the time being, developers design their apps in different ways. You may not be able to go back to your activity; but maybe should try accessing recent apps with your device and choose your app. Good luck Vance On Sep 14, 7:43 am, pramod shirsath shirsath.pra...@gmail.com wrote: when i click on androids back button it stops whole activitybut i want to come back to previous page..can anyone help me to solve this problem... -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- ThanksRegards Kaushik Pendurthi http://kaushikpendurthi.blogspot.com/ -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Back button problem
So...if you have 2 items in your listview and you delete one...and call your method that reloads the list you get 3 items instead of 1? Probably you just have to empty the list before re-adding the items that are in the db. On Thu, Dec 9, 2010 at 4:53 AM, pramod.deore deore.pramo...@gmail.comwrote: Hello , Now I had place the code that loads data from the database in a function and called that function when user hit the delete button . But now record gets deleted, but changes are not visible properly. (Properly means suppose there are 2 records and if I delete one record then at this time it shows me 3 records i.e 2 earlier and one after removing one record out of that 2 But actually one record gets successfully deleted. When I restarts the application and see the record then only one record it shows.) Then how to refresh this list view screen? On Dec 8, 4:47 pm, Kostya Vasilyev kmans...@gmail.com wrote: Also, don't do this: startActivity(getIntent()); This launches a new activity just like the current one. If you need to keep the current activity and update the UI with new data, just put that code in a function and call it when necessary. -- Kostya 08.12.2010 14:31, pramod.deore пишет: Thanks Kostya for your suggestion and link. On Dec 8, 4:27 pm, Kostya Vasilyevkmans...@gmail.com wrote: Pramod, Move the code that loads data from the database from onCreate to onStart. See this for an explanation: http://developer.android.com/guide/topics/fundamentals.html#actlife ( scroll down to see a very useful flowchart ) -- Kostya 08.12.2010 14:08, pramod.deore пишет: Hi everybody, In my application I am displaying list. I have created ContextMenu. In that there are options like add,remove,back,etc... Now when I select Remove option then I call method deleteRecord(), which delete that list record from database. After that I call method - startActivity(getIntent()); Because of this method activity restarts and list changes are instantly visible to user because in start method I had write code that display the list like. public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); try { sampleDB = this.openOrCreateDatabase(SAMPLE_DBNAME, MODE_PRIVATE, null); Cursor c = sampleDB.rawQuery (SELECT RoomName, SwitchFullName FROM SwitchTable ORDER BY RoomName,null); int count = c.getCount(); System.out.println (Total number of records are+count); if (c != null ) { if (c.moveToFirst()) { do { roomName = c.getString(c.getColumnIndex(RoomName)); switchName = c.getString(c.getColumnIndex(SwitchFullName)); System.out.println (roomName+:+switchName); results.add(roomName+-+switchName); } while (c.moveToNext()); c.close(); } } this.setListAdapter(new ArrayAdapterString(this, android.R.layout.simple_list_item_1,results)); } catch (SQLiteException se ) { Log.e(getClass().getSimpleName(), Could not create or Open the database); } finally { //sampleDB.close(); } registerForContextMenu(getListView()); } Now suppose I have list like this Hall - Fan Kitchen - AC Bedroom - tv and suppose I delete record no 1 then list display as following Kitchen - AC Bedroom - tv It looks perfectly well. But suppose I press the back button then list is again display as Hall - Fan Kitchen - AC Bedroom - tv Actually first record is deleted succesfully, but though also it is displayed when I press back button. How to avoid this problem? -- Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com -- Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- YuviDroid Check out Launch-X http://android.yuvalsharon.net/launchx.php (a widget to quickly access your favorite apps and contacts!)
Re: [android-developers] Re: Back button problem
nvm ill get back at you later On Wed, Dec 8, 2010 at 9:04 PM, pramod.deore deore.pramo...@gmail.comwrote: i dnt no how did u mail me Did I? On Dec 9, 9:47 am, nithya nataraj nithyan...@gmail.com wrote: hi, i am not android developer even i am learinig android like u and working on a application i dnt no how did u mail me tats k i no a bit abt database , i thnk ur printing these contents in logcat dnt do tat ,check in cmd prompt u can get wer is the mistake -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Back button problem
your on the list thats how i e-mail you On Wed, Dec 8, 2010 at 9:09 PM, shareem sharif mrshotki...@gmail.comwrote: nvm ill get back at you later On Wed, Dec 8, 2010 at 9:04 PM, pramod.deore deore.pramo...@gmail.comwrote: i dnt no how did u mail me Did I? On Dec 9, 9:47 am, nithya nataraj nithyan...@gmail.com wrote: hi, i am not android developer even i am learinig android like u and working on a application i dnt no how did u mail me tats k i no a bit abt database , i thnk ur printing these contents in logcat dnt do tat ,check in cmd prompt u can get wer is the mistake -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Back button problem
no no i want to know if you guys are ganna make something like the ipad On Wed, Dec 8, 2010 at 8:47 PM, nithya nataraj nithyan...@gmail.com wrote: hi, i am not android developer even i am learinig android like u and working on a application i dnt no how did u mail me tats k i no a bit abt database , i thnk ur printing these contents in logcat dnt do tat ,check in cmd prompt u can get wer is the mistake -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Back button problem
Hey YuviDroid Thanks for reply, Actually I am not calling new activity. In my activity's onCreate () method I am showing the list. In the same activity I am deleting list record But because display logic of list is in the onCreate() method of same activity therefore If I call startActivity(getIntent()); then list updates instantly. and If don't call startActivity(getIntent()); then record is deleted but list is not updates instantly. Now I want update list instantly. On Dec 8, 4:15 pm, YuviDroid yuvidr...@gmail.com wrote: Can't you just refresh the listview instead of creating a new Activity? If you instead really want to create a new one, before calling startActivity() call finish(), so that pressing back will skip that old list activity. On Wed, Dec 8, 2010 at 12:08 PM, pramod.deore deore.pramo...@gmail.comwrote: Hi everybody, In my application I am displaying list. I have created ContextMenu. In that there are options like add,remove,back,etc... Now when I select Remove option then I call method deleteRecord(), which delete that list record from database. After that I call method - startActivity(getIntent()); Because of this method activity restarts and list changes are instantly visible to user because in start method I had write code that display the list like. public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); try { sampleDB = this.openOrCreateDatabase(SAMPLE_DBNAME, MODE_PRIVATE, null); Cursor c = sampleDB.rawQuery (SELECT RoomName, SwitchFullName FROM SwitchTable ORDER BY RoomName,null); int count = c.getCount(); System.out.println (Total number of records are+count); if (c != null ) { if (c.moveToFirst()) { do { roomName = c.getString(c.getColumnIndex(RoomName)); switchName = c.getString(c.getColumnIndex(SwitchFullName)); System.out.println (roomName+:+switchName); results.add(roomName+-+switchName); } while (c.moveToNext()); c.close(); } } this.setListAdapter(new ArrayAdapterString(this, android.R.layout.simple_list_item_1,results)); } catch (SQLiteException se ) { Log.e(getClass().getSimpleName(), Could not create or Open the database); } finally { //sampleDB.close(); } registerForContextMenu(getListView()); } Now suppose I have list like this Hall - Fan Kitchen - AC Bedroom - tv and suppose I delete record no 1 then list display as following Kitchen - AC Bedroom - tv It looks perfectly well. But suppose I press the back button then list is again display as Hall - Fan Kitchen - AC Bedroom - tv Actually first record is deleted succesfully, but though also it is displayed when I press back button. How to avoid this problem? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- YuviDroid Check out Launch-X http://android.yuvalsharon.net/launchx.php (a widget to quickly access your favorite apps and contacts!)http://android.yuvalsharon.net -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Back button problem
Thanks Kostya for your suggestion and link. On Dec 8, 4:27 pm, Kostya Vasilyev kmans...@gmail.com wrote: Pramod, Move the code that loads data from the database from onCreate to onStart. See this for an explanation: http://developer.android.com/guide/topics/fundamentals.html#actlife ( scroll down to see a very useful flowchart ) -- Kostya 08.12.2010 14:08, pramod.deore пишет: Hi everybody, In my application I am displaying list. I have created ContextMenu. In that there are options like add,remove,back,etc... Now when I select Remove option then I call method deleteRecord(), which delete that list record from database. After that I call method - startActivity(getIntent()); Because of this method activity restarts and list changes are instantly visible to user because in start method I had write code that display the list like. public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); try { sampleDB = this.openOrCreateDatabase(SAMPLE_DBNAME, MODE_PRIVATE, null); Cursor c = sampleDB.rawQuery (SELECT RoomName, SwitchFullName FROM SwitchTable ORDER BY RoomName,null); int count = c.getCount(); System.out.println (Total number of records are+count); if (c != null ) { if (c.moveToFirst()) { do { roomName = c.getString(c.getColumnIndex(RoomName)); switchName = c.getString(c.getColumnIndex(SwitchFullName)); System.out.println (roomName+:+switchName); results.add(roomName+-+switchName); } while (c.moveToNext()); c.close(); } } this.setListAdapter(new ArrayAdapterString(this, android.R.layout.simple_list_item_1,results)); } catch (SQLiteException se ) { Log.e(getClass().getSimpleName(), Could not create or Open the database); } finally { //sampleDB.close(); } registerForContextMenu(getListView()); } Now suppose I have list like this Hall - Fan Kitchen - AC Bedroom - tv and suppose I delete record no 1 then list display as following Kitchen - AC Bedroom - tv It looks perfectly well. But suppose I press the back button then list is again display as Hall - Fan Kitchen - AC Bedroom - tv Actually first record is deleted succesfully, but though also it is displayed when I press back button. How to avoid this problem? -- Kostya Vasilyev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Back button problem
Also, don't do this: startActivity(getIntent()); This launches a new activity just like the current one. If you need to keep the current activity and update the UI with new data, just put that code in a function and call it when necessary. -- Kostya 08.12.2010 14:31, pramod.deore пишет: Thanks Kostya for your suggestion and link. On Dec 8, 4:27 pm, Kostya Vasilyevkmans...@gmail.com wrote: Pramod, Move the code that loads data from the database from onCreate to onStart. See this for an explanation: http://developer.android.com/guide/topics/fundamentals.html#actlife ( scroll down to see a very useful flowchart ) -- Kostya 08.12.2010 14:08, pramod.deore пишет: Hi everybody, In my application I am displaying list. I have created ContextMenu. In that there are options like add,remove,back,etc... Now when I select Remove option then I call method deleteRecord(), which delete that list record from database. After that I call method - startActivity(getIntent()); Because of this method activity restarts and list changes are instantly visible to user because in start method I had write code that display the list like. public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); try { sampleDB = this.openOrCreateDatabase(SAMPLE_DBNAME, MODE_PRIVATE, null); Cursor c = sampleDB.rawQuery (SELECT RoomName, SwitchFullName FROM SwitchTable ORDER BY RoomName,null); int count = c.getCount(); System.out.println (Total number of records are+count); if (c != null ) { if (c.moveToFirst()) { do { roomName = c.getString(c.getColumnIndex(RoomName)); switchName = c.getString(c.getColumnIndex(SwitchFullName)); System.out.println (roomName+:+switchName); results.add(roomName+-+switchName); } while (c.moveToNext()); c.close(); } } this.setListAdapter(new ArrayAdapterString(this, android.R.layout.simple_list_item_1,results)); } catch (SQLiteException se ) { Log.e(getClass().getSimpleName(), Could not create or Open the database); } finally { //sampleDB.close(); } registerForContextMenu(getListView()); } Now suppose I have list like this Hall - Fan Kitchen - AC Bedroom - tv and suppose I delete record no 1 then list display as following Kitchen - AC Bedroom - tv It looks perfectly well. But suppose I press the back button then list is again display as Hall - Fan Kitchen - AC Bedroom - tv Actually first record is deleted succesfully, but though also it is displayed when I press back button. How to avoid this problem? -- Kostya Vasilyev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com -- Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Back button problem
Hello , Now I had place the code that loads data from the database in a function and called that function when user hit the delete button . But now record gets deleted, but changes are not visible properly. (Properly means suppose there are 2 records and if I delete one record then at this time it shows me 3 records i.e 2 earlier and one after removing one record out of that 2 But actually one record gets successfully deleted. When I restarts the application and see the record then only one record it shows.) Then how to refresh this list view screen? On Dec 8, 4:47 pm, Kostya Vasilyev kmans...@gmail.com wrote: Also, don't do this: startActivity(getIntent()); This launches a new activity just like the current one. If you need to keep the current activity and update the UI with new data, just put that code in a function and call it when necessary. -- Kostya 08.12.2010 14:31, pramod.deore пишет: Thanks Kostya for your suggestion and link. On Dec 8, 4:27 pm, Kostya Vasilyevkmans...@gmail.com wrote: Pramod, Move the code that loads data from the database from onCreate to onStart. See this for an explanation: http://developer.android.com/guide/topics/fundamentals.html#actlife ( scroll down to see a very useful flowchart ) -- Kostya 08.12.2010 14:08, pramod.deore пишет: Hi everybody, In my application I am displaying list. I have created ContextMenu. In that there are options like add,remove,back,etc... Now when I select Remove option then I call method deleteRecord(), which delete that list record from database. After that I call method - startActivity(getIntent()); Because of this method activity restarts and list changes are instantly visible to user because in start method I had write code that display the list like. public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); try { sampleDB = this.openOrCreateDatabase(SAMPLE_DBNAME, MODE_PRIVATE, null); Cursor c = sampleDB.rawQuery (SELECT RoomName, SwitchFullName FROM SwitchTable ORDER BY RoomName,null); int count = c.getCount(); System.out.println (Total number of records are+count); if (c != null ) { if (c.moveToFirst()) { do { roomName = c.getString(c.getColumnIndex(RoomName)); switchName = c.getString(c.getColumnIndex(SwitchFullName)); System.out.println (roomName+:+switchName); results.add(roomName+-+switchName); } while (c.moveToNext()); c.close(); } } this.setListAdapter(new ArrayAdapterString(this, android.R.layout.simple_list_item_1,results)); } catch (SQLiteException se ) { Log.e(getClass().getSimpleName(), Could not create or Open the database); } finally { //sampleDB.close(); } registerForContextMenu(getListView()); } Now suppose I have list like this Hall - Fan Kitchen - AC Bedroom - tv and suppose I delete record no 1 then list display as following Kitchen - AC Bedroom - tv It looks perfectly well. But suppose I press the back button then list is again display as Hall - Fan Kitchen - AC Bedroom - tv Actually first record is deleted succesfully, but though also it is displayed when I press back button. How to avoid this problem? -- Kostya Vasilyev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com -- Kostya Vasilyev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Back button problem
hi, i am not android developer even i am learinig android like u and working on a application i dnt no how did u mail me tats k i no a bit abt database , i thnk ur printing these contents in logcat dnt do tat ,check in cmd prompt u can get wer is the mistake -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Back button problem
i dnt no how did u mail me Did I? On Dec 9, 9:47 am, nithya nataraj nithyan...@gmail.com wrote: hi, i am not android developer even i am learinig android like u and working on a application i dnt no how did u mail me tats k i no a bit abt database , i thnk ur printing these contents in logcat dnt do tat ,check in cmd prompt u can get wer is the mistake -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en