[android-developers] How can I get a reference to InputMethodService for an Android system app?
I have a requirement of changing the keyboard based on the change of language. I have done a bit of research and found that it can be done using these APIs 1. InputMethodManager setInputMethod(android.os.IBinder, java.lang.String) 2. InputMethodService switchInputMethod(java.lang.String) For the 1st API, I need an *IBinder token* which can be taken from *InputMethodService* instance by calling mInputMethodService.getWindow().getWindow().getAttributes().token or if I have the reference to *InputMethodService* object I can simply call mInputMethodService.switchInputMethod(id) to change the input method. *The real problem is how do I get a reference to InputMethodService object.* *PS:* I don't want to use InputMethodManager's showInputMethodPicker() because for my requirement I want to change it from my existing dialog which has a list of languages. I know that this is not possible for a user app but not sure if it's also not possible for a system app or not. -- 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] AutoCompleteTextView for contacts
Hi I would like to say that I am developing an android SMS app. I am using AutoCompleteTextView for contacts suggestions. Here I am using SimpleAdapter with three fields name, phoneNumber and phoneType. But when I put any text like m, it suggests all contacts with phoneType mobile. Same if I put h, it suggests all contacts with phoneType home. But I want to get only suggestions for name and phoneNumber not phoneType . Regards, Muhammad Rashid -- 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: Best solution for touchable Toast-like notification for plugin library
Why not use the standard Android notification system? Regarding plugins, I found useful this talk from Mark Murphy, since I'm working too in a plugin architecture for one of my apps: http://www.youtube.com/watch?v=Xu8Z_3TaWuE Hope this helps Cheers, José https://play.google.com/store/apps/developer?id=Jos%C3%A9+Gonz%C3%A1lez+D%27Amico El viernes, 17 de enero de 2014 23:44:39 UTC-3, Glenn Powell escribió: We are building a plugin library, which will be integrated into third-party applications. It requires the ability to show Toast-like notifications, which when tapped, will open our fullscreen widget Dialog. From my research it appears that Toasts were designed to explicitly ignore any touch input. The next best option seems to be one of either a PopupWindow, a Fragment, another Dialog with a transparent background, or about 25 different solutions. We don't want to trap touches on the entire screen, only over our notification popup. I am new to Android, so I'm curious to learn what the optimal solution would be. I have seen other plugin integrations do similar things, so I think there is probably an obvious way to tackle this. If you've implemented something like this, can you please give us some pointers? 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 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] AutoCompleteTextView for contacts
On Thu, Jan 23, 2014 at 5:54 AM, Muhammad Rashid muhammad.rash...@gmail.com wrote: But when I put any text like m, it suggests all contacts with phoneType mobile. Same if I put h, it suggests all contacts with phoneType home. But I want to get only suggestions for name and phoneNumber not phoneType . Without some code or more information, sounds like you're just querying the wrong column(s) when filtering. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- 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] Open URL in Fragment causes ActivityNotFoundException
Hi all, I'm working on the APP to show multiple images with Fragment which contains an ImageView control. And I also set the onClickListener for the image view to open some URL with startActivity. But unfortunately, the App crashed with ActivityNotFoundException. Below is the code and the error messages, can anyone give me some suggestion about this issue? Thanks in advance. @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.ad_fragment_layout, container, false); imgView = (ImageView)v.findViewById(R.id.ad_image); if (!loadImageFromFile()) { imgView.setImageResource(mRes); } imgView .setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent(Intent.ACTION_VIEW); i.addCategory(Intent.CATEGORY_BROWSABLE); i.setData(Uri.parse(www.google.com)); getActivity().startActivity(i); }}); return v; } The error message: 01-23 08:23:37.439: E/AndroidRuntime(7032): FATAL EXCEPTION: main 01-23 08:23:37.439: E/AndroidRuntime(7032): Process: com.mppp, PID: 7032 01-23 08:23:37.439: E/AndroidRuntime(7032): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW cat=[android.intent.category.BROWSABLE] dat=www.google.com } 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1723) 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1491) 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.app.Activity.startActivityForResult(Activity.java:3436) 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.app.Activity.startActivityForResult(Activity.java:3393) 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:824) 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.app.Activity.startActivity(Activity.java:3644) 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.app.Activity.startActivity(Activity.java:3607) 01-23 08:23:37.439: E/AndroidRuntime(7032): at com.mppp.app.view.main.ADFragment$2.onClick(ADFragment.java:74) 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.view.View.performClick(View.java:4456) 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.view.View$PerformClick.run(View.java:18462) 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.os.Handler.handleCallback(Handler.java:733) 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.os.Handler.dispatchMessage(Handler.java:95) 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.os.Looper.loop(Looper.java:136) 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.app.ActivityThread.main(ActivityThread.java:5102) 01-23 08:23:37.439: E/AndroidRuntime(7032): at java.lang.reflect.Method.invokeNative(Native Method) 01-23 08:23:37.439: E/AndroidRuntime(7032): at java.lang.reflect.Method.invoke(Method.java:515) 01-23 08:23:37.439: E/AndroidRuntime(7032): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 01-23 08:23:37.439: E/AndroidRuntime(7032): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 01-23 08:23:37.439: E/AndroidRuntime(7032): at dalvik.system.NativeStart.main(Native Method) -- 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] Open URL in Fragment causes ActivityNotFoundException
Does it work if you add http://; to your URL? It sounds like your device/emulator has no application to handle the browsing (right word?) of that kind of data (an URI with no protocol declared). Marina On Thu, Jan 23, 2014 at 2:11 PM, Stanley Lei xiaofeng.lei...@gmail.comwrote: Hi all, I'm working on the APP to show multiple images with Fragment which contains an ImageView control. And I also set the onClickListener for the image view to open some URL with startActivity. But unfortunately, the App crashed with ActivityNotFoundException. Below is the code and the error messages, can anyone give me some suggestion about this issue? Thanks in advance. @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.ad_fragment_layout, container, false); imgView = (ImageView)v.findViewById(R.id.ad_image); if (!loadImageFromFile()) { imgView.setImageResource(mRes); } imgView .setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent(Intent.ACTION_VIEW); i.addCategory(Intent.CATEGORY_BROWSABLE); i.setData(Uri.parse(www.google.com)); getActivity().startActivity(i); }}); return v; } The error message: 01-23 08:23:37.439: E/AndroidRuntime(7032): FATAL EXCEPTION: main 01-23 08:23:37.439: E/AndroidRuntime(7032): Process: com.mppp, PID: 7032 01-23 08:23:37.439: E/AndroidRuntime(7032): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW cat=[android.intent.category.BROWSABLE] dat=www.google.com } 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1723) 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1491) 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.app.Activity.startActivityForResult(Activity.java:3436) 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.app.Activity.startActivityForResult(Activity.java:3393) 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:824) 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.app.Activity.startActivity(Activity.java:3644) 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.app.Activity.startActivity(Activity.java:3607) 01-23 08:23:37.439: E/AndroidRuntime(7032): at com.mppp.app.view.main.ADFragment$2.onClick(ADFragment.java:74) 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.view.View.performClick(View.java:4456) 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.view.View$PerformClick.run(View.java:18462) 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.os.Handler.handleCallback(Handler.java:733) 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.os.Handler.dispatchMessage(Handler.java:95) 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.os.Looper.loop(Looper.java:136) 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.app.ActivityThread.main(ActivityThread.java:5102) 01-23 08:23:37.439: E/AndroidRuntime(7032): at java.lang.reflect.Method.invokeNative(Native Method) 01-23 08:23:37.439: E/AndroidRuntime(7032): at java.lang.reflect.Method.invoke(Method.java:515) 01-23 08:23:37.439: E/AndroidRuntime(7032): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 01-23 08:23:37.439: E/AndroidRuntime(7032): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 01-23 08:23:37.439: E/AndroidRuntime(7032): at dalvik.system.NativeStart.main(Native Method) -- 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
[android-developers] Re: Best solution for touchable Toast-like notification for plugin library
I don't think Notifications will work, since our popups need to show up inside the publisher's app that has integrated our plugin. I believe Notifications are only supposed to be used outside of apps, and I'm not sure if they react to touches like we will need. As for plugin frameworks, we do already have something in place, but I will watch through that Android talk when I have some time. Thanks On Thursday, January 23, 2014 5:31:01 AM UTC-8, Jose_GD wrote: Why not use the standard Android notification system? Regarding plugins, I found useful this talk from Mark Murphy, since I'm working too in a plugin architecture for one of my apps: http://www.youtube.com/watch?v=Xu8Z_3TaWuE Hope this helps Cheers, José https://play.google.com/store/apps/developer?id=Jos%C3%A9+Gonz%C3%A1lez+D%27Amico El viernes, 17 de enero de 2014 23:44:39 UTC-3, Glenn Powell escribió: We are building a plugin library, which will be integrated into third-party applications. It requires the ability to show Toast-like notifications, which when tapped, will open our fullscreen widget Dialog. From my research it appears that Toasts were designed to explicitly ignore any touch input. The next best option seems to be one of either a PopupWindow, a Fragment, another Dialog with a transparent background, or about 25 different solutions. We don't want to trap touches on the entire screen, only over our notification popup. I am new to Android, so I'm curious to learn what the optimal solution would be. I have seen other plugin integrations do similar things, so I think there is probably an obvious way to tackle this. If you've implemented something like this, can you please give us some pointers? 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 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] Open URL in Fragment causes ActivityNotFoundException
Thanks Marina, you're right, it's working now with the http://; prefix. What a stupid error!! On Thursday, January 23, 2014 10:06:15 AM UTC-8, Marina Cuello wrote: Does it work if you add http://; to your URL? It sounds like your device/emulator has no application to handle the browsing (right word?) of that kind of data (an URI with no protocol declared). Marina On Thu, Jan 23, 2014 at 2:11 PM, Stanley Lei xiaofen...@gmail.comjavascript: wrote: Hi all, I'm working on the APP to show multiple images with Fragment which contains an ImageView control. And I also set the onClickListener for the image view to open some URL with startActivity. But unfortunately, the App crashed with ActivityNotFoundException. Below is the code and the error messages, can anyone give me some suggestion about this issue? Thanks in advance. @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.ad_fragment_layout, container, false); imgView = (ImageView)v.findViewById(R.id.ad_image); if (!loadImageFromFile()) { imgView.setImageResource(mRes); } imgView .setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent(Intent.ACTION_VIEW); i.addCategory(Intent.CATEGORY_BROWSABLE); i.setData(Uri.parse(www.google.com)); getActivity().startActivity(i); }}); return v; } The error message: 01-23 08:23:37.439: E/AndroidRuntime(7032): FATAL EXCEPTION: main 01-23 08:23:37.439: E/AndroidRuntime(7032): Process: com.mppp, PID: 7032 01-23 08:23:37.439: E/AndroidRuntime(7032): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW cat=[android.intent.category.BROWSABLE] dat=www.google.com } 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1723) 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1491) 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.app.Activity.startActivityForResult(Activity.java:3436) 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.app.Activity.startActivityForResult(Activity.java:3393) 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:824) 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.app.Activity.startActivity(Activity.java:3644) 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.app.Activity.startActivity(Activity.java:3607) 01-23 08:23:37.439: E/AndroidRuntime(7032): at com.mppp.app.view.main.ADFragment$2.onClick(ADFragment.java:74) 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.view.View.performClick(View.java:4456) 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.view.View$PerformClick.run(View.java:18462) 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.os.Handler.handleCallback(Handler.java:733) 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.os.Handler.dispatchMessage(Handler.java:95) 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.os.Looper.loop(Looper.java:136) 01-23 08:23:37.439: E/AndroidRuntime(7032): at android.app.ActivityThread.main(ActivityThread.java:5102) 01-23 08:23:37.439: E/AndroidRuntime(7032): at java.lang.reflect.Method.invokeNative(Native Method) 01-23 08:23:37.439: E/AndroidRuntime(7032): at java.lang.reflect.Method.invoke(Method.java:515) 01-23 08:23:37.439: E/AndroidRuntime(7032): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 01-23 08:23:37.439: E/AndroidRuntime(7032): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 01-23 08:23:37.439: E/AndroidRuntime(7032): at dalvik.system.NativeStart.main(Native Method) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-d...@googlegroups.comjavascript: To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com javascript: 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 javascript:. 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] Outgoing Call
Hi, I am arun , working as a android developer. now i am stuck with one problem.please help me. My problem is I want to identified my outgoing call is answered or not how can i achieve this. -- *Regards* *Arun* -- 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] Outgoing Call
You can create a broadcast reciever, using this you can register to system events, like a new email has arrived, system boot is complete or a phone call is received and react accordingly. On Fri, Jan 24, 2014 at 11:57 AM, Arun Kumar K arunkuma...@npcompete.netwrote: Hi, I am arun , working as a android developer. now i am stuck with one problem.please help me. My problem is I want to identified my outgoing call is answered or not how can i achieve this. -- *Regards* *Arun* -- 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.