[android-developers] Re: RelativeLayout passes EXACTLY measure spec mode where it should pass AT_MOST
More information: In the attached project, add the following attributes to MyImageView/ : android:adjustViewBounds=true android:scaleType=centerCrop If MyImageView/ is inside FrameLayout/ the (expected) result will be: https://lh6.googleusercontent.com/-pQTK6-yNnq8/UqweuRGc3FI/ZCw/rI3n8Uh2K7o/s1600/Bug-FrameLayout.png If MyImageView/ is inside RelativeLayout/ the (unexpected) result will be: https://lh5.googleusercontent.com/-ytxB6oDaiAQ/UqweTHs0S8I/ZCo/EEHPIGVd47g/s1600/Bug-RelativeLayout.png This kind of behavior makes it absolutely impossible to write any serious layout algorithms :( -- 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Re: Displaying Google Map Android API V2 in fragment
Hi, I have done same task, adding Map inside fragment, where fragment is placed inside ViewPager. public class Map extends Fragment { /** The view. */ private static View view; /** The g map. */ private static GoogleMap gMap; /** The bangalore. */ private final LatLng BANGALORE = new LatLng(12.971689, 77.594504); /** The zoom. */ private float zoom = 11.0f; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (container == null) { return null; } if (view != null) { ViewGroup parent = (ViewGroup) view.getParent(); if (parent != null) parent.removeView(view); } try { view = inflater.inflate(R.layout.map, container, false); setUpMapIfNeeded(); } catch (InflateException e) { // Log.wtf(S*, e.getMessage()); } return view; } @Override public void onViewCreated(View view, Bundle savedInstanceState) { gMap = null; if (gMap != null) setUpMap(); if (gMap == null) { gMap = ((SupportMapFragment) this.getActivity().getSupportFragmentManager() .findFragmentById(R.id.mapd)).getMap(); if (gMap != null) setUpMap(); } } /* Sets up the map if it is possible to do so */ public void setUpMapIfNeeded() { if (gMap == null) { gMap = ((SupportMapFragment) getActivity().getSupportFragmentManager() .findFragmentById(R.id.mapd)).getMap(); if (gMap != null) setUpMap(); } } /** * This is where we can add markers or lines, add listeners or move the * camera. * p * This should only be called once and when we are sure that {@link #gMap} * is not null. */ private void setUpMap() { gMap.addMarker(new MarkerOptions().position(BANGALORE).title(My Home) .snippet(Home Address)); gMap.animateCamera(CameraUpdateFactory.newLatLngZoom(BANGALORE, zoom)); } / * The mapfragment's id must be removed from the FragmentManager or else if * the same it is passed on the next time then app will crash / // @Override // public void onDestroyView() { // super.onDestroyView(); // FragmentManager fm = getActivity().getSupportFragmentManager(); // Fragment fragment = (fm.findFragmentById(R.id.mapd)); // FragmentTransaction ft = fm.beginTransaction(); // ft.remove(fragment); // ft.commit(); // } } On Thursday, 5 December 2013 14:04:28 UTC+5:30, surabhi jain wrote: Hi All, I have problem in showing Google map (API V2) in fragment. I am using ViewPager, inside that I have created my layout and also displaying map. I have created Map dynamically using SupportMapFragment. I have 3 pager (Fragment), all 3 fragments will showing map. When I switch to 1st fragment to 2nd fragment at that time map is not displaying in my 2nd fragment layout. Showing black screen. :( -- Thanks Regards Surabhi Jain -- 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Re: Displaying Google Map Android API V2 in fragment
17:08 (1 minute ago) Hi, I have done same task, adding Map inside fragment, where fragment is placed inside ViewPager. public class Map extends Fragment { /** The view. */ private static View view; /** The g map. */ private static GoogleMap gMap; /** The bangalore. */ private final LatLng BANGALORE = new LatLng(12.971689, 77.594504); /** The zoom. */ private float zoom = 11.0f; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (container == null) { return null; } if (view != null) { ViewGroup parent = (ViewGroup) view.getParent(); if (parent != null) parent.removeView(view); } try { view = inflater.inflate(R.layout.map, container, false); setUpMapIfNeeded(); } catch (InflateException e) { // Log.wtf(S*, e.getMessage()); } return view; } @Override public void onViewCreated(View view, Bundle savedInstanceState) { gMap = null; if (gMap != null) setUpMap(); if (gMap == null) { gMap = ((SupportMapFragment) this.getActivity(). getSupportFragmentManager() .findFragmentById(R.id.mapd)).getMap(); if (gMap != null) setUpMap(); } } /* Sets up the map if it is possible to do so */ public void setUpMapIfNeeded() { if (gMap == null) { gMap = ((SupportMapFragment) getActivity().getSupportFragmentManager() .findFragmentById(R.id.mapd)).getMap(); if (gMap != null) setUpMap(); } } /** * This is where we can add markers or lines, add listeners or move the * camera. * This should only be called once and when we are sure that {@link #gMap} * is not null. */ private void setUpMap() { gMap.addMarker(new MarkerOptions().position(BANGALORE).title(My Home) .snippet(Home Address)); gMap.animateCamera(CameraUpdateFactory.newLatLngZoom(BANGALORE, zoom)); } / * The mapfragment's id must be removed from the FragmentManager or else if * the same it is passed on the next time then app will crash / // @Override // public void onDestroyView() { // super.onDestroyView(); // FragmentManager fm = getActivity().getSupportFragmentManager(); // Fragment fragment = (fm.findFragmentById(R.id.mapd)); // FragmentTransaction ft = fm.beginTransaction(); // ft.remove(fragment); // ft.commit(); // } } In the above code, uncomment *onDestroyView() *only if necessary. manytimes destroying after saving, will crash. but it's upto you. -- 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Re: Swipe app out of recent tasks permanently kills app (like force-stop) even though it's running background services!
You have to use *START_STICKY*http://developer.android.com/reference/android/app/Service.html#START_STICKYwhich is a sticky service, also add flag *FLAG_FROM_BACKGROUND http://developer.android.com/reference/android/content/Intent.html#FLAG_FROM_BACKGROUND*while starting your service. when you use START_STICKY make sure you do not pass any data via intent, since your app/activity is killed, but you can re-start the service. Ex : you need to read the values from Sensors and do operations. all the values are generated within the service only. @Override public int onStartCommand(Intent intent, int flags, int startId) { // We want this service to continue running until it is explicitly stopped, so return sticky. return START_STICKY; } you have to call *stopService(); http://developer.android.com/reference/android/content/Context.html#stopService%28android.content.Intent%29*manually to kill the service, else you will use huge memory. -- 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [android-developers] Country filter
Could be a speed cameras app, but those are illegal in all of France, regardless of the user's nationality. -- 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [android-developers] Re: Swipe app out of recent tasks permanently kills app (like force-stop) even though it's running background services!
Just as a note: you're being fairly condescending to people who are suggesting solutions to you free of charge in a pretty polite way.. I personally don't know what the semantics of the swipe away are: but I wouldn't be surprised if it were to kill the app. I am not sure whether or not I'd call it a bug or not (I'd personally lean toward not) but it's obvious you feel differently. If nobody else (presumably, someone who's read the source..) responds to this you could always dig through the system source to find out! Kris On Fri, Dec 13, 2013 at 6:59 AM, 3c ccouno...@gmail.com wrote: Thanks but I'm fully aware of this and as the title suggest I'm referring to swiping an app from the recent task list. Not sure how this has anything to do with this. On Android 4.4, the recent task list is now acting like a force-stop and that's a definitive and obvious bug. And this behavior is anything but what end-users do expect when removing apps from recent list. I've already received a dozen reports from end-users who think my app stops functioning unexpectedly, while they only swiped it away from the recent list, they expect its services to continue running! How nice this is when an app actually has widgets on the launcher? Those simply stop refreshing forever! If that's not a bug, I guess Android OS and my app both have 0 bug. I'll make sure to refer my users to your posts so they understand there's no bug! Have a read at these: http://developer.android.com/reference/android/app/Service.html#onTaskRemoved(android.content.Intent) http://developer.android.com/reference/android/content/pm/ServiceInfo.html#FLAG_STOP_WITH_TASK On Friday, December 13, 2013 4:25:42 AM UTC+1, RichardC wrote: Have a read of: Launch controls on stopped applications in http://developer.android.com/about/versions/android-3.1.html Note that it says: Applications are in a stopped state when they are first installed but are not yet launched and when they are manually stopped by the user (in Manage Applications). This was introduced in 3.1 before we had swiping away. On Friday, December 13, 2013 1:22:27 AM UTC, 3c wrote: I cannot agree with this as the recent task list in no way suggest killing the apps. Actually every users seems to see it differently. Some take that recent task list as the name suggest, recent tasks and activities, others see it as you suggest an app killing, but most users don't know what's actually happening when removing a task from that list. Furthermore that list doesn't actually reflect apps still running, but the recent tasks or apps used by end-user. On boot I may have a dozen apps running, but no way to kill them (except going into settings, force-stop) if I haven't started them once, making this task killer the worse I've ever seen: it requires end-user to open the app before being able to kill it permanently! And it's not because I remove a task from that very list that I don't want its services to continue running. Looking at documentation for the Service class and the related manifest attributes definitely confirm the behavior of Android 4.0 to 4.3: With Android 4.4, the below flag is now ineffective, which falls into the bug category, not the other way around as you suggest. public static final int stopWithTask Added in API level 14 If set to true, this service with be automatically stopped when the user remove a task rooted in an activity owned by the application. The default is false. Must be a boolean value, either true or false. public void onTaskRemoved (Intent rootIntent) Added in API level 14 This is called if the service is currently running and the user has removed a task that comes from the service's application. If you have set ServiceInfo.FLAG_STOP_WITH_TASK then you will not receive this callback; instead, the service will simply be stopped. -- 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- 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
Re: [android-developers] Re: Swipe app out of recent tasks permanently kills app (like force-stop) even though it's running background services!
So far I didn't see any solution, only reference to documentation that's unrelated. So talking about condescending... And its as if no one even care to read the actual documentation that relates to this issue which I've clearly posted. As if I didn't know what force stop was doing or if my services where not sticky services... Which is clearly stated too. I'll check the suggested option to set from background flag if it actually helps. Le 14 déc. 2013 17:37, Kristopher Micinski krismicin...@gmail.com a écrit : Just as a note: you're being fairly condescending to people who are suggesting solutions to you free of charge in a pretty polite way.. I personally don't know what the semantics of the swipe away are: but I wouldn't be surprised if it were to kill the app. I am not sure whether or not I'd call it a bug or not (I'd personally lean toward not) but it's obvious you feel differently. If nobody else (presumably, someone who's read the source..) responds to this you could always dig through the system source to find out! Kris On Fri, Dec 13, 2013 at 6:59 AM, 3c ccouno...@gmail.com wrote: Thanks but I'm fully aware of this and as the title suggest I'm referring to swiping an app from the recent task list. Not sure how this has anything to do with this. On Android 4.4, the recent task list is now acting like a force-stop and that's a definitive and obvious bug. And this behavior is anything but what end-users do expect when removing apps from recent list. I've already received a dozen reports from end-users who think my app stops functioning unexpectedly, while they only swiped it away from the recent list, they expect its services to continue running! How nice this is when an app actually has widgets on the launcher? Those simply stop refreshing forever! If that's not a bug, I guess Android OS and my app both have 0 bug. I'll make sure to refer my users to your posts so they understand there's no bug! Have a read at these: http://developer.android.com/reference/android/app/Service.html#onTaskRemoved(android.content.Intent) http://developer.android.com/reference/android/content/pm/ServiceInfo.html#FLAG_STOP_WITH_TASK On Friday, December 13, 2013 4:25:42 AM UTC+1, RichardC wrote: Have a read of: Launch controls on stopped applications in http://developer.android.com/about/versions/android-3.1.html Note that it says: Applications are in a stopped state when they are first installed but are not yet launched and when they are manually stopped by the user (in Manage Applications). This was introduced in 3.1 before we had swiping away. On Friday, December 13, 2013 1:22:27 AM UTC, 3c wrote: I cannot agree with this as the recent task list in no way suggest killing the apps. Actually every users seems to see it differently. Some take that recent task list as the name suggest, recent tasks and activities, others see it as you suggest an app killing, but most users don't know what's actually happening when removing a task from that list. Furthermore that list doesn't actually reflect apps still running, but the recent tasks or apps used by end-user. On boot I may have a dozen apps running, but no way to kill them (except going into settings, force-stop) if I haven't started them once, making this task killer the worse I've ever seen: it requires end-user to open the app before being able to kill it permanently! And it's not because I remove a task from that very list that I don't want its services to continue running. Looking at documentation for the Service class and the related manifest attributes definitely confirm the behavior of Android 4.0 to 4.3: With Android 4.4, the below flag is now ineffective, which falls into the bug category, not the other way around as you suggest. public static final int stopWithTask Added in API level 14 If set to true, this service with be automatically stopped when the user remove a task rooted in an activity owned by the application. The default is false. Must be a boolean value, either true or false. public void onTaskRemoved (Intent rootIntent) Added in API level 14 This is called if the service is currently running and the user has removed a task that comes from the service's application. If you have set ServiceInfo.FLAG_STOP_WITH_TASK then you will not receive this callback; instead, the service will simply be stopped. -- 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
Re: [android-developers] Re: Swipe app out of recent tasks permanently kills app (like force-stop) even though it's running background services!
And I did dig into the sources. App is permanently killed, except for manifest registered events (unverified) and alarms. So any sticky device not relying on those is a dead service. In 4.4.x only that is. I found a work around but its so dirty I wait for a better option if any before posting. Le 14 déc. 2013 17:37, Kristopher Micinski krismicin...@gmail.com a écrit : Just as a note: you're being fairly condescending to people who are suggesting solutions to you free of charge in a pretty polite way.. I personally don't know what the semantics of the swipe away are: but I wouldn't be surprised if it were to kill the app. I am not sure whether or not I'd call it a bug or not (I'd personally lean toward not) but it's obvious you feel differently. If nobody else (presumably, someone who's read the source..) responds to this you could always dig through the system source to find out! Kris On Fri, Dec 13, 2013 at 6:59 AM, 3c ccouno...@gmail.com wrote: Thanks but I'm fully aware of this and as the title suggest I'm referring to swiping an app from the recent task list. Not sure how this has anything to do with this. On Android 4.4, the recent task list is now acting like a force-stop and that's a definitive and obvious bug. And this behavior is anything but what end-users do expect when removing apps from recent list. I've already received a dozen reports from end-users who think my app stops functioning unexpectedly, while they only swiped it away from the recent list, they expect its services to continue running! How nice this is when an app actually has widgets on the launcher? Those simply stop refreshing forever! If that's not a bug, I guess Android OS and my app both have 0 bug. I'll make sure to refer my users to your posts so they understand there's no bug! Have a read at these: http://developer.android.com/reference/android/app/Service.html#onTaskRemoved(android.content.Intent) http://developer.android.com/reference/android/content/pm/ServiceInfo.html#FLAG_STOP_WITH_TASK On Friday, December 13, 2013 4:25:42 AM UTC+1, RichardC wrote: Have a read of: Launch controls on stopped applications in http://developer.android.com/about/versions/android-3.1.html Note that it says: Applications are in a stopped state when they are first installed but are not yet launched and when they are manually stopped by the user (in Manage Applications). This was introduced in 3.1 before we had swiping away. On Friday, December 13, 2013 1:22:27 AM UTC, 3c wrote: I cannot agree with this as the recent task list in no way suggest killing the apps. Actually every users seems to see it differently. Some take that recent task list as the name suggest, recent tasks and activities, others see it as you suggest an app killing, but most users don't know what's actually happening when removing a task from that list. Furthermore that list doesn't actually reflect apps still running, but the recent tasks or apps used by end-user. On boot I may have a dozen apps running, but no way to kill them (except going into settings, force-stop) if I haven't started them once, making this task killer the worse I've ever seen: it requires end-user to open the app before being able to kill it permanently! And it's not because I remove a task from that very list that I don't want its services to continue running. Looking at documentation for the Service class and the related manifest attributes definitely confirm the behavior of Android 4.0 to 4.3: With Android 4.4, the below flag is now ineffective, which falls into the bug category, not the other way around as you suggest. public static final int stopWithTask Added in API level 14 If set to true, this service with be automatically stopped when the user remove a task rooted in an activity owned by the application. The default is false. Must be a boolean value, either true or false. public void onTaskRemoved (Intent rootIntent) Added in API level 14 This is called if the service is currently running and the user has removed a task that comes from the service's application. If you have set ServiceInfo.FLAG_STOP_WITH_TASK then you will not receive this callback; instead, the service will simply be stopped. -- 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 unsubscribe from this group and stop receiving emails from it, send an email to
Re: [android-developers] Google Drive says Action Bars on the bottom are ok?
split action bar? https://developer.android.com/guide/topics/ui/actionbar.html#SplitBar -- Douglas Drumond *GDG Campinas http://www.gdg-campinas.org google.com/+DouglasDrumond http://google.com/+DouglasDrumond – @douglasdrumond http://twitter.com/douglasdrumond* 2013/12/12 Ken kenk...@gmail.com On Thursday, December 12, 2013 4:40:45 PM UTC-5, Kostya Vasilyev wrote: Do you mean the panel that slides up and down as you scroll the documents list? Google+ does this too. Yep...the panel at the bottom w/ the Camera button. I thought Google said not to do this? :-P It's a weird UI pattern. Almost seems to conflict w/ the other UI pattern where the softkeys (back/home/etc.) hide when you're viewing content. Scroll down and the camera panel shows up...touch the bottom of the screen and the softkeys show up. It works fine if your device has hardkeys for the home button like a Galaxy S3, but doesn't work well on the N7. There's even a library for it named AndroidSlidingUpPanel. -- 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [android-developers] Google Drive says Action Bars on the bottom are ok?
Somewhat related. What's that thing called on Gmail where they got three bars in the upper left that slides out to become a menu on the left? -- 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [android-developers] Google Drive says Action Bars on the bottom are ok?
On Saturday, December 14, 2013 7:17:44 PM UTC-8, Nathan wrote: Somewhat related. What's that thing called on Gmail where they got three bars in the upper left that slides out to become a menu on the left? Ok, it's a navigation drawer. Back to subject at hand, this doesn't appear related. Nathan -- 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.