android-intent

Android : android.intent.action.BOOT_COMPLETED on ICS and Gingerbread

心不动则不痛 提交于 2020-01-02 06:20:24
问题 My application is listening to android.intent.action.BOOT_COMPLETED.. Android :2.3 i am able to get the broadcast when my application is Shut/Active before Boot up. Android : 4.0.3 I am not able to get the broadcast when my application is Shut(Force Close ) before Boot up. Reason is as in this link Starting with 3.1 when applications are installed they are in a “stopped” state so they will not be able to run until the user explicitly launches them. Pressing Force Stop will return them to this

File not found error after selecting a file in android

让人想犯罪 __ 提交于 2020-01-02 05:32:06
问题 I want to open a .pdf file in my android app.now i can browse the pdf file and after browsing the file I am getting File Not Found Error when i check the file exist or not. Now after selecting the file my selected file Uri data.getData() is like content://com.android.externalstorage.documents/document/6333-6131:SHIDHIN.pdf and the path when i parse using data.getData().getPath().toString() is like /document/6333-6131:SHIDHIN.pdf Here is my code. Please Help me. // To Browse the file Intent

How to manage multiple Activity stacks in an Android app, like you would on iOS with multiple UINavigationControllers within a UITabBarController?

…衆ロ難τιáo~ 提交于 2020-01-02 05:14:25
问题 A fairly common model for iOS apps seems to have a single UITabBarController, where each tab essentially holds a UINavigationController, i.e. a stack of controllers, and pressing a tab switches to the top of the corresponding stack. Can I get the same behavior on Android without a lot of custom code? (Note: I am using menus instead of tabs on Android). After reading http://developer.android.com/guide/topics/fundamentals/tasks-and-back-stack.html the closest I can see is to have multiple tasks

how to end up my outgoing call.

心已入冬 提交于 2020-01-02 05:03:10
问题 with statrtActivity(callIntent) , call goes and then i have to wait for few seconds and end automatically. to end up my call i have taken mycalss extends Broadcastreceiver then in that onreceive() i implemented.in that method i got only to set old number and newnumber and toast is printing. What i want exactly is to end call what i need to write. and how to call onreceive method from my class? plase help me. i didnt get anywhere. @Override public void onReceive(Context context, Intent intent)

onActivityResult getting called as soon as camera intent is sent

若如初见. 提交于 2020-01-02 04:49:08
问题 I am using the camera intent to launch the camera in my app but as soon as the intent gets fired the onActivityResult gets fired and I have not even taken a picture yet. When I do take a picture, select it and return back to my activity the onActivityResult does not get called at all here is how I launch the camera PackageManager pm = getPackageManager(); if (pm.hasSystemFeature(PackageManager.FEATURE_CAMERA)) { Intent camera = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); File tempDir = new

define Action bar overflow items

北城以北 提交于 2020-01-02 04:38:07
问题 If I define the following items for my action bar: res/menu/action_menu.xml : <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:title="label"/> <item android:title="label1"/> <item android:title="label2"/> <item android:title="label3"/> <item android:title="label4"/> </menu> In my Activity: @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.action_menu

How to show the “internal storage” option in an ActionOpenDocument intent by default

▼魔方 西西 提交于 2020-01-02 04:11:06
问题 I need the user to select a file of a custom filetype that they've dragged onto their android device from windows file explorer, but the internal storage option isn't available by default. When I launch the intent using this: var libraryIntent = new Intent(Intent.ActionOpenDocument); libraryIntent.SetType("application/*"); _activity.StartActivityForResult(libraryIntent, (int)ActivityRequestCode.ImportFeatureCodeLibrary); Android OS (5.1 and 6.0) shows the following screen: The user has to

Android Share Intent chooser - Sharing TEXT with Facebook/Twitter Social media etc

二次信任 提交于 2020-01-02 03:47:13
问题 If I only send text, the Share Intent chooser DOES NOT give Facebook/Twitter as an option. Only Gmail, Skype and Evernote are options. Here is my code Intent shareIntent = new Intent(Intent.ACTION_SEND); shareIntent.setType("plain/text"); shareIntent.putExtra(Intent.EXTRA_TEXT, text) startActivity(Intent.createChooser(shareIntent, "Share using")); I have tried different combination of setType() with no joy including "text/*", "text/html" and passing HTML text in the putExtra as follows:

android insert into activity stack

家住魔仙堡 提交于 2020-01-02 03:30:11
问题 Here is the question: Let's say the activity stack consist of A->B->C. If user followed the order eg: Start A -> B -> C, pressing back button will cause C->B->A. However, if user entered directly into activity C (eg: via notification), pressing back button will cause the app to close, instead of going into B->A. How do I insert the into the activity stack to become A->B->C, so that when user pressed back at C, it will always back to B. Thanks 回答1: just overide the onBackPressed() method and

Starting Settings Activity for result

戏子无情 提交于 2020-01-02 03:17:16
问题 In my application I'm checking whether the GPS is enabled on the user's device, and if not I would like to send him to the Settings to let him turn it on. Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS); startActivityForResult(intent, LocationHelper.LOCATION_SETTINGS_REQUEST_CODE); After the user closes Settings screen, I would to perform an action right inside the onActivityResult() . @Override public void onActivityResult(int requestCode, int resultCode, Intent data) {