intent

how could I get default sms app's package name?

匿名 (未验证) 提交于 2019-12-03 08:57:35
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: As default sms app is added in 4.4, I cannot open default sms app like this: Intent intent = new Intent(Intent.ACTION_MAIN); intent.addCategory(Intent.CATEGORY_DEFAULT); intent.setType("vnd.android-dir/mms-sms"); startActivity(intent); So how could I get default sms app's package name, so I can open it from my app directly? 回答1: // http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.4.4_r1/android/provider/Settings.java#Settings.Secure.0SMS_DEFAULT_APPLICATION public static final String SMS_DEFAULT

Android process is bad error on killing the app

匿名 (未验证) 提交于 2019-12-03 08:57:35
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Here is the exact error 02-08 12:36:43.490 3479-4980/? W/ActivityManager: Scheduling restart of crashed service com.wfl/.StepTrackerShakeDetectorService in 1000ms 02-08 12:36:44.494 3479-3513/? W/ActivityManager: Unable to launch app com.wfl/10139 for service Intent { cmp=com.wfl/.StepTrackerShakeDetectorService }: process is bad Here is the scenario It is basically a step tracker StepTrackerShakeDetectorService is implemented to restart automatically when app is destroyed using START_STICKY But when the app is removed from task list I am

Start an activity from a fragment

匿名 (未验证) 提交于 2019-12-03 08:57:35
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have 2 fragments with on both fragments a button. When I press the button I'd like to start a new Activity. But I can't get it to work. The error I'm getting: ERROR here: Type mismatch: cannot convert from mFragmentFavorite to Fragment What am I doing wrong? MyFragmentPagerAdapter import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; public class MyFragmentPagerAdapter extends FragmentPagerAdapter{ final int PAGE_COUNT = 3; /** Constructor of the class */

Android Search Interface not submitting query

匿名 (未验证) 提交于 2019-12-03 08:56:10
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've implemented a Search Interface (the Search Widget) by following the official tutorial for Search Interface closely. It all looks good but I can't submit the search query. When I click the "Send" button on the keyboard nothing happens. Here is what I did: AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="18" /> <uses-permission android:name="android.permission.GET_ACCOUNTS" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android

startActivityForResult(Intent intent, int requestCode, Bundle options) how to retrieve the extra bundle option?

匿名 (未验证) 提交于 2019-12-03 08:54:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: According to the Android documentation public void startActivityForResult (Intent intent, int requestCode, Bundle options) . I can not figure it out how to retrieve the extra bundle options that I am passing on the intent. I want to pass an ArrayList with data as an extra bundle option when I am calling the startActivityForResult method. Sample of code: ArrayList<String> list = new ArrayList<>(); list.add("test1"); list.add("test2"); Bundle bundleOptions = new Bundle(); bundleOptions.putStringArrayList("key", list); startActivityForResult

Intent Filters and android:pathPattern

匿名 (未验证) 提交于 2019-12-03 08:54:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In my application, I want to handle links that use the following pattern: scheme://host/folder1/folder2/folder3/folder4/article I got it to work temporarily, by using the following: <intent-filter> <data android:scheme="http" /> <data android:host="www.laprensa.com.ni" /> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> </intent-filter> However, as you may imagine that opens any link that starts with scheme://host ,

Is it possible to install an application via adb but still get Google Market updates?

匿名 (未验证) 提交于 2019-12-03 08:54:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: My company is distributing both the hardware (samsung galaxy tab 10.1) and the software (my application) to our customers. My intent is to "skip" the google account linking and use adb to install my production-signed application directly onto the tablet (identical as the apk I upload to google market). This will allow me to pre-configure the tablets for our customers, change the screen background to our logo, etc. However, once the tablet has been delivered to the customer, I would want them to attach a google account to the tablet

Intent onDestroy() always being called with back button

匿名 (未验证) 提交于 2019-12-03 08:54:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I appear to have the opposite issue to every other post on the topic I have come across. Others find that onDestroy() is not always called but I find it always and immediately is. I am checking whether it is called with the following: @Override protected void onDestroy() { super.onDestroy(); Log.d(TAG, "onDestroy"); } This log code is triggered immediately after either clicking back or using my actionbar button which just calls the home activity as an intent. I have looked around but everyone says the lifecycle should look like this: http:/

how to check whether email client installed on device

匿名 (未验证) 提交于 2019-12-03 08:52:47
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I need to check whether email client is installed on a device or not. I have used the following code but it does not work for me. public boolean isIntentAvailable () { final PackageManager packageManager = getApplicationContext (). getPackageManager (); final Intent intent = new Intent ( Intent . ACTION_SEND ); intent . putExtra ( Intent . EXTRA_EMAIL , "vin@gmail.com" ); List < ResolveInfo > list = packageManager . queryIntentActivities ( intent , PackageManager . GET_META_DATA ); return list . size () > 0 ; } 回答1: Use this, works

permission denied when I try to startService

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am trying to access an InputMethodService from an Activity , and I am running into issues with the permissions. This is for a custom keyboard app. What I am trying to achieve is to bind the text, which is created in the Activity back into the InputMethodService . The Activity is opened from the InputMethodService , then from the Activity , I try to start the Service (which may be the issue. Here is how I open the Activity from the InputMethodService : @Override public void onStartInputView ( EditorInfo attribute , boolean