android-intent

How to collect logs for every event which occurs in android device?

血红的双手。 提交于 2019-12-25 14:20:11
问题 I wanted to collect log for every event which occurs in android device like when user starts any application or when any application have notification for user. Currently I have broadcast receiver listening for every event but it did not listened to certain events, so I searched on internet and it suggested to give priority to events while registering then in manifest file. Now the question is should I give priority to every event and if yes what priority should I give them. Thanks. 回答1:

open a sqlite database when choosing folder with ACTION_OPEN_DOCUMENT_TREE

寵の児 提交于 2019-12-25 14:09:45
问题 I have an already existing sqlite database in a folder /sdcard/myfolder/db/mydb.db . My app shows a dialog to choose a folder: Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE); startActivityForResult(intent, 42); The Dialog pops up and I can choose the folder: I choose the folder /sdcard/myfolder/db/ and press choose/ok. My onActivityResult gets called. I go through all files and if the file is my "mydb.db" then I try to open the sqlite database with SQLiteDatabase.openDatabase();

Intent.ACTION_CALL is not working when a pop up window opens to select my account

佐手、 提交于 2019-12-25 13:29:09
问题 I am implementing an Android app that will allow users to purchase something by dialing a number from my app pressing a button. In single SIM devices it works nicely, but in dual sim devices, when I run my app and click on the "Purchase Button" a popup window automatically opens to ask me which SIM I want to use to dial (I didn't have to write code for this action, It automatically done by my device. Also when I normally call a friend using the default Phone App of my device this pop up

Replacing default Home Screen Android

非 Y 不嫁゛ 提交于 2019-12-25 12:44:36
问题 in my application I achieved the resul that my app is one of the Home Activity that start when my tablet start. The code in the android Manifest is the Following: <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.HOME" /> <category android:name="android.intent.category.DEFAULT" /> The result that i want to achieve is that the user cannot choose if the first activity to start should be the mine activity or the default home activity. I would to

Including drawer in all activities xml and calling them when clicked

自古美人都是妖i 提交于 2019-12-25 12:40:11
问题 I am working on an Android project in which I am using drawer for showing some always used activities. I have made sure that the activities dont need any special data, and can be started once logged in. But I dont know how to include the drawer in all XML files where I have my activities. I cannot find any good reference. Also, When I do that, how can i start the activity instead of using fragments. So, for example, below is an example of my RestaurantLists xml file and displaying users xml

Not able to get rid of NullPointerException when changing brightness of an image and passing the brightness value to another intent

穿精又带淫゛_ 提交于 2019-12-25 10:21:49
问题 In my app, I am changing the brightness of an image within an ImageView in Activity B and I'm passing the image as well as the brightness changed to Activity A. But when recieving the result in Activity A, I get a NullPointerException. Here is part of code in Activity A: On a button click: btn_Edit.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent editIntent = new Intent(HowItWorksActivity.this, EditPhotoActivity.class); if (current_working_image

Not able to get rid of NullPointerException when changing brightness of an image and passing the brightness value to another intent

左心房为你撑大大i 提交于 2019-12-25 10:21:13
问题 In my app, I am changing the brightness of an image within an ImageView in Activity B and I'm passing the image as well as the brightness changed to Activity A. But when recieving the result in Activity A, I get a NullPointerException. Here is part of code in Activity A: On a button click: btn_Edit.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent editIntent = new Intent(HowItWorksActivity.this, EditPhotoActivity.class); if (current_working_image

how to launch another activity from fragment with putting chosen member info into extras?

我的未来我决定 提交于 2019-12-25 10:17:40
问题 Here is the first page that contents fragment activity_fpage.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" > <ImageView

Enable or disable launch intent-filter activities with one button

半城伤御伤魂 提交于 2019-12-25 09:30:26
问题 I have an app with several activities, they all have a launch intent-filter in the manifest so they can show several icons on the launcher, there is a main activity and the rest of them are disabled by default with android:enabled="false" here is a part of my manifest: <activity android:name="com.myapp.MainActivity" android:icon="@mipmap/ic_launcher" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent

How to share image and text on pinterest using intent

谁说我不能喝 提交于 2019-12-25 09:24:49
问题 I want to share image and text on pinterest using intent. Any ideas? 回答1: You have to first check pintrest application is installed into device or not using this function. private boolean appInstalledOrNot(String uri) { PackageManager pm = getPackageManager(); boolean app_installed; try { pm.getPackageInfo(uri, PackageManager.GET_ACTIVITIES); app_installed = true; } catch (PackageManager.NameNotFoundException e) { app_installed = false; } return app_installed; } If this function returns you