[android-developers] Package Manager API clarification required.....
Hi, I am using PackageManager API to disable some component. ComponentName name = new ComponentName(context, className); className == the class object of the class i wanted to disable. This class is my Home category with higher priority than Homescreen app. Now while disabling the class i wanted to give flag PackageManager.DONT_KILL_APP because i do not want all the activities running in that package to die immediately. pm.setComponentEnabledSetting(name, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP); Now if i upgrade my phone with BOTA package placed in SD card and when my phone boots up, i see that my componet(className) got enabled and my class is recieving the Home Intent instead of the actual HomeScreen app. All my settings and userdata is still persisting. Why the component gets enabled after upgrade ??? I think its not the behaviour that is expected. The component should still be disabled. Thanks, Sudeep -- 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] Package Manager API clarification required.....
Thanks for the reply From the docs : public static final int COMPONENT_ENABLED_STATE_DISABLED Since: API Level 1 Flag for setApplicationEnabledSetting(String, int, int) and setComponentEnabledSetting(ComponentName, int, int): This component or application has been explicitly disabled, regardless of what it has specified in its manifest. Constant Value: 2 (0x0002) There is no state mentioned in manifest for the upgraded component, it should be in Disabled state until user enables it or Factory reset of phone is done. Please can anybody help to understand why component got enabled after BOTA upgrade. Is it a bug in android framework ?? or I am missing something here? On 6/26/12, Justin Anderson magouyaw...@gmail.com wrote: My guess, though I very well may be wrong, is that it is because the enabled/disabled state in the manifest file of the upgrade app overwrites the enabled/disabled state of the component. Thanks, Justin Anderson MagouyaWare Developer http://sites.google.com/site/magouyaware On Tue, Jun 26, 2012 at 5:38 AM, Sudeep Sharma sudeep.andr...@gmail.comwrote: Hi, I am using PackageManager API to disable some component. ComponentName name = new ComponentName(context, className); className == the class object of the class i wanted to disable. This class is my Home category with higher priority than Homescreen app. Now while disabling the class i wanted to give flag PackageManager.DONT_KILL_APP because i do not want all the activities running in that package to die immediately. pm.setComponentEnabledSetting(name, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP); Now if i upgrade my phone with BOTA package placed in SD card and when my phone boots up, i see that my componet(className) got enabled and my class is recieving the Home Intent instead of the actual HomeScreen app. All my settings and userdata is still persisting. Why the component gets enabled after upgrade ??? I think its not the behaviour that is expected. The component should still be disabled. Thanks, Sudeep -- 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 -- 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 -- 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] Package Manager API clarification required.....
No it should not be the case because when you buy a new android phone Google Google Setup Wizard package runs which has a Home category activity(com.google.android.setupwizard/.SetupWizardActivity having higher priority than home screen) which activates the phone, ask for setting up google account and then disables the Home category activity(com.google.android.setupwizard/.SetupWizardActivity) and actual Home screen comes. For this case manifest doesnt have any explicit state enabled/disabled. The default value android:enabled is true if not stated. Disabling of SetupWizardActivity in this case happens at run time only. Now if you upgrade the phone to a higher android version and phone reboots, SetupWizardActivity should start again but that is not the case and Home intent is recieved by HomeScreen. It means in upgrade the activity which is disabled will remain disabled. So i am wondering if I am disabling correctly or not ? But as per API I am disabling it correctly because until upgrade happens my activity is disabled. pm.setComponentEnabledSetting(name, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP); I think somebody from google android framework team should comment. Thanks , Sudeep On 6/26/12, jc jroma...@gmail.com wrote: On Tuesday, June 26, 2012 10:40:28 AM UTC-5, MagouyaWare wrote: There is no state mentioned in manifest for the upgraded component, it should be in Disabled state until user enables it or Factory reset of phone is done. Why? I didn't read it that way. I agree that it is not well-defined, but the docs do not say that this should be the case. I would suspect that upgrading doesn't retain your runtime setting because it resets back to the manifest value, or in your case the DEFAULT value since you don't have it defined in your manifest. http://developer.android.com/guide/topics/manifest/application-element.html http://developer.android.com/guide/topics/manifest/activity-element.html -- 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 -- 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] Enforcing clearTop only when launching app from browser
i think when u launch it from browser, launch it as new_task and also add intent extra to identify that its launched from browser. once u do this override the onNewIntent method. in this method check for your intent extra and do something like this.. @Override protected void onNewIntent(Intent intent) { super.onNewIntent(); check intent extra to identify if launched from browser if yes then do below things. finish(); getApplicationContext().startActivity(new Intent(getApplicationContext(), SplashActivity.class) .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)); } } Wednesday, June 27, 2012, Goat666 anand.tha...@gmail.com wrote: Hi everyone! I have an application with an activity named SplashActivity which has the following intent-filters defined. activity android:name=.SplashActivity android:configChanges=keyboardHidden|orientation android:launchMode=singleTop android:screenOrientation=portrait android:windowSoftInputMode=adjustPan intent-filter action android:name=android.intent.action.MAIN / category android:name=android.intent.category.LAUNCHER / /intent-filter intent-filter action android:name=android.intent.action.VIEW/ category android:name=android.intent.category.DEFAULT/ category android:name=android.intent.category.BROWSABLE/ data android:scheme=abc/ /intent-filter /activity Hence the activity can be launched from the launcher or from the browser by using the scheme abc:parameters. Scenario 1: I launch the app (SplashActivity) from the launcher and from SplashActivity I launch MainActivity. Now the task has 2 activities with MainActivity on top. I minimize with the HOME key and then relaunch the app from the launcher. I will see the same 2 activity stack preserved. This is the desired behavior so all is well. Scenario 2: I launch the app (SplashActivity) from the launcher and from SplashActivity I launch MainActivity. Now the task has 2 activities with MainActivity on top. I minimize with the HOME key and then launch a special webpage. This webpage has a button that launches a url with the scheme abc:data. This launches SplashActivity. However, this is launched in the browser task. I would like for the original minimized task to be launched with SplashActivity as the root (FLAG_ACTIVITY_NEW_TASK might unify SplashActivity with the original instance that was in the background) and I would also like to add a flag of FLAG_ACTIVITY_CLEAR_TOP so that MainActivity is closed. How do I achieve this? The most promising option seemed to be to define SplashActivity as singleTask but for various reasons singleTask does not perform exactly as desired. Most importantly, it seems to clear all the activities on top each time you relaunch SplashActivity. This is fine for Scenario 2 but in Scenario 1 I do not wish to clear the activities on top. So my question is, how can I achieve an outcome in Scenario 2 where on clicking the button on the webpage, my app is launched with SplashActivity at the root (not in the browser task) and MainActivity is closed. The issue is that we can't control the intent from the browser. Thanks! -- 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 -- 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: Loader Manager behaviour problem
Sorryit was my mistakethe uri i was registring was not correct.loader and loader manager works perfectly. On 3/22/12, Sudeep Sharma sudeep.andr...@gmail.com wrote: Hi, Please help me on this. I have my own class similar to CursorLoader which extends AsyncTaskLoader. I need to do multiple queries to network so I am using LoaderManager callbacks. I do not use ForceLoadContentObserver in my implementation, instead i use normal ContentObserver. 1. I do a initLoader with say id loader id 1., initially i get a cursor with empty count in onLoadFinished() but since i also register on content observer, onLoadFinished() gets hit again with some data and its displayed on UI. 2. Now when i need to refresh my data on listview through some button, i destroy my loader with id 1 and create a new loader with id 2 (new instance of my customized Cursor loader class gets created) and control hits again on onLoadFinished() with some data. Now in mean while my content observer also gets hit as fresh data is fetched from network but when i check isStarted() function of Loader to decide whether to call forceLoad or not, it returns false, also i printed isReset() function as false, which means that Loader is reset by the time Content observer got hit. Why is it so? How it is diffrent from the first case when i started loader with id 1. In second case i just destroyed the loader with id1 and did initloader with id 2. Also i tried in second case that if i did a restart on loader id 1 instead of destroying, then also when my content observer gets hit i see isStarted() as false. Due to this I am not able to pass the new/refreshed data to my app. Please can anybody help me in understanding this or is this a LoaderManager bug. Thanks Regards, Sudeep. -- 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] Loader Manager behaviour problem
Hi, Please help me on this. I have my own class similar to CursorLoader which extends AsyncTaskLoader. I need to do multiple queries to network so I am using LoaderManager callbacks. I do not use ForceLoadContentObserver in my implementation, instead i use normal ContentObserver. 1. I do a initLoader with say id loader id 1., initially i get a cursor with empty count in onLoadFinished() but since i also register on content observer, onLoadFinished() gets hit again with some data and its displayed on UI. 2. Now when i need to refresh my data on listview through some button, i destroy my loader with id 1 and create a new loader with id 2 (new instance of my customized Cursor loader class gets created) and control hits again on onLoadFinished() with some data. Now in mean while my content observer also gets hit as fresh data is fetched from network but when i check isStarted() function of Loader to decide whether to call forceLoad or not, it returns false, also i printed isReset() function as false, which means that Loader is reset by the time Content observer got hit. Why is it so? How it is diffrent from the first case when i started loader with id 1. In second case i just destroyed the loader with id1 and did initloader with id 2. Also i tried in second case that if i did a restart on loader id 1 instead of destroying, then also when my content observer gets hit i see isStarted() as false. Due to this I am not able to pass the new/refreshed data to my app. Please can anybody help me in understanding this or is this a LoaderManager bug. Thanks Regards, Sudeep. -- 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] LoaderManager/CursorLoader query.....
Hi, When using LoaderManager and Cursor loader, we get the Cursor object in onLoadFinished() callback. Since the content observer is registered with Cursor loader, that cursor will be updated and we get many callbacks for onLoadFinished() This is fine!!! If now after some time the cursor is closed, so do we still receive this callback when content changes? -- 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] on tab click get tab number
Can you be please be more clear ..i couldn't understand On Sat, Feb 25, 2012 at 11:48 AM, Jagruti Sangani jagruti.sang...@inextrix.com wrote: hello, i want to get which tab i have clicked.i have use the tab onchangelistener but it will give tab number after click on any other tab and then click on the again first tab.so anybody know how it is possible to gtet on click tab number.plz if possible give code. -- 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 -- 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] Query on LoaderManager/CursorLoader behaviour
Hi, I have a query with respect to list fragment which uses loader manager callbacks and cursor loader. When onLoadFinished is called with cursor, and if i pass this cursor to some background service which uses the information in cursor. While the background service is running and if i destroy the loader, so will the cursor also be destroyed with it ? I have to destroy the loader because there may be many queries like that to database and i can not launch new loaders for each query? Also please let me know if there is a way to make a copy of cursor ??? something like cloning. Thanks... -- 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] Accessing Shared pref across Applications.
Hi Guys, Please can anybody help me on this. I wanted to read a shared preference from a diffrent apk. Currently i tried several options but I am unable to do so. Also i have read in several forums where i found a mix of comments where its posted that it is not at all possible and some suggest it can be done I have tried using these flags while writing the flag like MODE_MULTI_PROCESS, MODE_WORLD_READABLE, MODE_PRIVATE but with no success so far. Please can anybody suggest me if I need to do anything extra here. Thanks, -- 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] Navigation Tabs converted to Drop down on orientation change in Action bar of ICS.
Thanks a lot Mark !! On 1/17/12, Mark Murphy mmur...@commonsware.com wrote: Well, I filed an issue: http://code.google.com/p/android/issues/detail?id=24439 but I suspect that it is the way it is. This feature is semi-documented: Note: In some cases, the Android system will show your action bar tabs as a drop-down list in order to ensure the best fit in the action bar. on http://developer.android.com/guide/topics/ui/actionbar.html#Tabs Personally, I find the behavior mystifying, which is why I filed the issue. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, One Low Price! -- 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 -- 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] Navigation Tabs converted to Drop down on orientation change in Action bar of ICS.
Hi Guys, I have a query related to Action bar in ICS. As we all know Action bar supports both mode , 1. Navigation Tabs 2. Drop-down Navigation. I have an Activity with Action bar and added Navigation Tabs such that each Tab text is lengthy. (say TAB1, TAB2, TAB3, TAB4. etc...) So the view i will be seeing in the portrait mode will be as shown in snapshot_portrait.png which is attached with this email. If the Tab doesn't fit in Portrait mode, the desired tab can be reached by fling action. Now changing the orientation, the Tabbed view changes to a drop down if all the tabs doesnt fit the entire landscape view width. I wanted to have the same Tabbed views in landscape mode too where fling action can slide the tabs.. Please can anybody let me know how can i achieve this. Appreciate your quick reply. Thanks... -- 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=enattachment: snapshot_portrait.png
[android-developers] Need to ask ask question on Home key action on Emergency-Dialer
Hi, Can anyone please help me knowing the reason for this behaviour. The activity which shows the Emergency Dialer (packages/apps/Phone/src/com/android/phone) is EmergencyDialer.java. Now i have a question that if my phone is *not provisioned* (means : Secure.DEVICE_PROVISIONED is set to 0), how come the Home key is functional on the Emergency Dialer screen and not on any other activity *till this bit get sets to 1 ?*? Suppose when my phone boots up for the first time after a factory reset (I set my activity as high priority home app category), and in my Home activity I launch emergency dialer through a button click, and then press Home key there, why my existing Home activity is destroyed and i get the Home Intent such that my Home activity gets created again and also i recieve the onNewIntent followed by the onCreate. My Home activity is singleTask launch mode. but this happens only for the first time when Emergency dialer is launched and home key is pressed there. (Sequence : Phone boots up - My Home activity is launched (onCreate) - click button to launch emergency dialer - press home key - my Home activity recieves onDestroy - onCreate - onNewIntent. ) === is it not something strange what i read from android docs for onNewIntent. For the other tries after this (Sequence : My Home activity is there - click button to launch emergency dialer - press home key - my Home activity recieves onNewIntent.) ===This is expected behaviour. Why the first time i got onDestroy when i pressed Home key on Emergency dialer. Is this some Android framework Bug . Please help me on this. I shall be thankful to you. Thanks Regards, Sudeep. -- 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: Virtual keyboard moves the image upwards
Hello, I think i myself found the solution. using android:windowSoftInputMode=stateAlwaysHidden|adjustResize fixes the issue. adjustPan was also one alternative but its not behaving consistently. Also i read the below post from Dianne Hackborn regarding adjustPan:- But generally I would *strongly* suggest not using adjustPan. It is mostly there for compatibility with apps that can't resize themselves to account for the IME. It is intrinsically a poorer user experience than adjustResize because when the IME is displayed the user can't scroll around in the window's content. *** Thanks .. On Wed, Jun 29, 2011 at 1:10 AM, Sudeep Sharma sudeep.andr...@gmail.comwrote: Hi, In the package com.android.setupwizard where the first screen displays the Android Logo and an animated hand arrives, i see one issue there. When you try to open virtual keyboard by long press menu, the Android logo moves up and the image is half cut. I have a similar image and want to prevent that going out of screen when the virtual keyboard comes up. Can anybody suggest something? My expectation will be that virtual keyboard covers the previous activity instead moving the image upwards. Thanks, -- 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] Virtual keyboard moves the image upwards
Hi, In the package com.android.setupwizard where the first screen displays the Android Logo and an animated hand arrives, i see one issue there. When you try to open virtual keyboard by long press menu, the Android logo moves up and the image is half cut. I have a similar image and want to prevent that going out of screen when the virtual keyboard comes up. Can anybody suggest something? My expectation will be that virtual keyboard covers the previous activity instead moving the image upwards. Thanks, -- 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] Question on Broadcast receiver with some prioroty set and category set as Home
Hi, I have an application set as Home category having higher priority than the normal Home app. This is to show my app first as soon as the phone boots up. I have a broadcast receiver also within my manifest which also has same category home with priority even more than of my activity. Problem is when the phone is booted i do not see control coming in the Broadcast reciever (xyzReciever) at all although its priority is higher than that of activity. Is action android:name=android.intent.action.MAIN / category android:name=android.intent.category.HOME / category android:name=android.intent.category.DEFAULT / not applicable for Broadcast recievers? *Activity Properties* activity android:name=.ABC android:launchMode=singleTask android:clearTaskOnLaunch=true android:configChanges=keyboardHidden|orientation android:excludeFromRecents=true intent-filter android:priority=*101* action android:name=android.intent.action.MAIN / category android:name=android.intent.category.HOME / category android:name=android.intent.category.DEFAULT / /intent-filter *Reciever properties* receiver android:name=.xyzReciever intent-filter android:priority=*102* action android:name=android.intent.action.MAIN / category android:name=android.intent.category.HOME / category android:name=android.intent.category.DEFAULT / /intent-filter /receiver Please respond I shall be thankful. Thanks -- 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] onCreate and onNewIntent sequence
Hi, I have two activities A and B activity android:name=.A android:label=@string/A android:launchMode=singleTask android:clearTaskOnLaunch=true android:taskAffinity=.A android:configChanges=keyboardHidden|orientation|locale android:theme=@android:style/Theme.Dialog android:excludeFromRecents=true intent-filter android:priority=101 action android:name=android.intent.action.MAIN / category android:name=android.intent.category.HOME / category android:name=android.intent.category.DEFAULT / /intent-filter A is of category home with higher priority than normal Home Screen activity. This is basically done to launch this A as soon as phone powers up. From A i launch B using startActivity. Now press Home key, i see that A which was already there gets destroyed and again A's onCreate is called immediately followed by onNewIntent. I was of the view that if already activity is there then only onNewIntent is called. Can anybody please help me in this? I want to understand why pressing home key caused A to destroy first and then onCreate and onNewIntent are called simultaneously. How ever this happens only the first time Home key is *pressed after power up*, after that if A is already there control goes to onNewIntent properly. Thanks -- 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: setSingleChoiceItems api usage in a dialog
Gulfam, Thanks for the suggestion !! It worked. But similarly with android.R.layout.simple_list_item_2, in this case the same situation was there that radio button was not displayed. Now as per your solution the layout is there for single line item(android.R.layout.simple_list_item_single_choice). There is no android.R.layout.simple_list_item_single_choice for double line list item(layout.simple_list_item_2) Do i need to make my own layout and handle the logic for single choice to be selected for radio button??? Thanks Regards, Amit On Tue, Dec 14, 2010 at 3:55 PM, Gulfam gulfa...@gmail.com wrote: Try to use this layout (android.R.layout.simple_list_item_single_choice) instead of (android.R.layout.simple_list_item_1). I hope this will help you. Gulfam On Dec 14, 12:03 pm, Sudeep Sharma sudeep.andr...@gmail.com wrote: Hi, I am using the API of Alert Dialog builder 1. public Builder setSingleChoiceItems(R.array.select_dialog_items2, int checkedItem, final OnClickListener listener) 2. public Builder setSingleChoiceItems(ListAdapter adapter, int checkedItem, final OnClickListener listener) The problem is that if i use a android.R.layout.simple_list_item_1 and above api using adapter for populating the contents in array adapter, i get the dialog as shown in snapshot1 where i *do not* see a radio button at the right hand side of the item. Please see snapshot1.png But if i use the first api of (R.array.select_dialog_items2 == DIALOG_SINGLE_CHOICE of Api demo's), then i get the snapshot2.png. This is little strange for me. I expected the radio button in previous case also. * code snippet : private ArrayAdapterString setAdapter1() { // this function will return the adapter which will be passed in the *setSingleChoiceItems* final Context dialogContext = new ContextThemeWrapper(this, android.R.style.Theme_Light); final LayoutInflater dialogInflater = (LayoutInflater)dialogContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); final String[] titles = getResources().getStringArray( R.array.select_dialog_items2); final ArrayAdapterString adapter = new ArrayAdapterString(this, android.R.layout.simple_list_item_1, titles) { @Override public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) { convertView = dialogInflater.inflate(android.R.layout.simple_list_item_1, parent, false); } TextView title = (TextView) convertView.findViewById(android.R.id.text1); title.setText(titles[position]); return convertView; } }; return adapter; } * Can anybody suggest something why the difference? Thanks Regards, Amit snapshot1.png 22KViewDownload snapshot2.png 26KViewDownload -- 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] Trying to change the Search text field of QSB
Hi, Can anyone please let me know where is the xml file located for inflating the QSB with Text Search filed(Text View) and the default string Quick Search Box getting displayed in it. I wanted to change some attributes in the text view which gets displayed to enter the text for search. I searched package/apps/GlobalSearch, i could see the search_hint string for displaying the Quick Search Box but how is the Text View getting displayed. Help will be appreciated. Thanks , Sudeep. -- 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] activity stack issue :help please
Hi, I am seeing an issue regarding Activity stack . Suppose i launch dialler app from Home screen and exit from it. After that i go to Settings---Call Settings--Operator Selection and then press the back key. Instead of seeing the CallSettings activity dialler app is activity is shown. From the logs i see that resume of dialler app is called somehow and thats why dialler apps comes first and now if i press back again then i can see Call Settings Activity. Can anyone tell me what can be wrong here. Regards, Sudeep. -- 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: Restore last viewed Activity
I think you can also save the Preferenceor make use of onSaveInstance method to achiev your goal. On Mon, Sep 21, 2009 at 7:12 AM, Mingli Wang rint...@gmail.com wrote: I think you could save some variable in file , and read it in your application's onCreate and start the specific activity --~--~-~--~~~---~--~~ 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: Text View issue....
Hi Mark Murphy, Please let me know the resolution for this.. Thanks in advance for your help. ~Sudeep... On 9/9/09, Sudeep sudeep.andr...@gmail.com wrote: Hi, I have a list view with diffrent widgets(Text View , check box, togglebutton etc). I know in touch mode that text view need not get focussed if user touches the text view as this is expected behaviour of Android framework. The problem I am facing is that when i click on the textview, it should show a momentary orange highlight to show the user what the user has clicked, but this is not happening for me and simply the functionality expected by that touch is performed. What I am missing...?? Can anybody help please in this that how do i get this textview momentary highlighted in orange colour on touching it so that user knows that he has made touch selection for this textview.??? Thanks and Regards, Sudeep --~--~-~--~~~---~--~~ 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] textview issue....
Hi, I have a list view with diffrent widgets(Text View , check box, togglebutton etc). I know in *touch mode* that text view need not be focussed if user touches the text view as this is expected behaviour of Android framework. When i click on the textview, it should show a momentary orange highlight, but this is not happening for me and simply the functionality is performed. What I am missing...?? Can anybody help please in this that how do i get this textview momentary highlighted in orange colour on touching it so that user knows that he has made touch selection for this textview.??? Thanks Regards, Sudeep --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---