android-intent

Send data to activity when Firebase notification is clicked in Android

烂漫一生 提交于 2019-12-22 15:11:48
问题 In my application I want use fireBase for notification . I want when click on notification (when app is closed, my mean is app is background ) send data with putExtra to mainActivity . I write below codes, but when click on notification (in app is background) but show me null for getStringExtra ! MyNotificationManager class : public class MyNotificationManager { private Context mCtx; private Uri soundUri; private static MyNotificationManager mInstance; public MyNotificationManager(Context

Excluding the mime type from Android manifest file

回眸只為那壹抹淺笑 提交于 2019-12-22 14:59:31
问题 I am using android sharing functionality by putting this code in androidmainfest.xml <action android:name="android.intent.action.SEND" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="*/*" /> In my application currently i do not support handling of "plain/text". Otherwise i support all other kind of mime types. is there any way i can mention the type in the manifest.xml which i wan't to exclude from handling rather than mentioning all the types which i

Open specific activity from url

 ̄綄美尐妖づ 提交于 2019-12-22 14:56:13
问题 I want open specific activity my app android after click url my website from browser android. if my url = <a href="http://myapp.com/aa-bb-cc-dd.html"> open activity </a> and my activity is DetailActivity , how to open this activity after click my url ? and I want " aa-bb-cc-dd " for setText Textview in DetailActivity . text1.setText(" aa "); text2.setText(" bb "); text3.setText(" cc "); text4.setText("dd"); How its work? 回答1: In your AndroidManifest.xml , declare that your DetailActivity can

Android notifications multiple times

核能气质少年 提交于 2019-12-22 14:01:01
问题 I have notifications that remind user to take the medicine. When I add new times for taking medicines, for example, at 9:00 pm and 9:01 pm, only last notification is active. Here is my code: AddTime.java: (part) Cursor cursor2 = sqdb.rawQuery("SELECT Name FROM Medicine WHERE _id = " + mId, null); while(cursor2.moveToNext()) { med = cursor2.getString(cursor2.getColumnIndex("Name")); } //med - Name of medicine String sql = "SELECT _id FROM Time WHERE mId = "+mId+" AND Year = "+year+" AND Month

Difference between myactivity.this , myactivity.class, this

£可爱£侵袭症+ 提交于 2019-12-22 13:53:02
问题 I have been trying to use Intent method in my program , the code shows no error when I use myactivity.this ... when I use the other two ( myactivity.class or this ),eclipse shows an error. Intent i = new Intent(myActivity.this,myActivity2.class); startActivity(i); When I use myactivity.class or this in the first param, Eclipse shows an error of Constructor Intent not defined . Why is that, can anyone explain? 回答1: myActivity.this == Refrence to context myActivity2.class == Reference to class,

In Android, how can I detect why my activity was resumed?

时光毁灭记忆、已成空白 提交于 2019-12-22 12:37:42
问题 I'm developing an Activity that does some of its own state management. I'm trying to differentiate the following onResume cases: New launch task switch (home button long-click) resume after other activity in the same application wake-up after sleep orientation change Is there something in the Activity's intent, or elsewhere, that can help me differentiate these? For the curious and some context... I'd like to preserve my internal history stack on 4 & 5. On cases 2 & 3, I would preserve the

How to call same activity (same layout) with different data?

做~自己de王妃 提交于 2019-12-22 12:21:18
问题 I am new to android field. i am developing restaurant menu application, i have created list view which shows names of items in restaurant. when i select any one item in list view it will launch another activity, it contains text view field showing detail description of selected item. similarly when i select other items, it should launch same activity but data should be of that selected item, how to achieve this ? if i use sqlite database for data source. 回答1: You need to pass the values

android putextra without start activity

你说的曾经没有我的故事 提交于 2019-12-22 11:21:45
问题 i need help please. I have two activities and a db. All i want to do is when i press a button in activity A, i send the string in my editText to the activity B. In the activity B i try to insert that string in my db and display it in a listview. All works if i start the activity B in the activity A but i wont display the activity B. Here my code: Activity A: public class Example extends Activity { public final static String ID_EXTRA2="com.example.activities"; public EditText MyInputText =

Open application settings via Intent from preferences.xml

一个人想着一个人 提交于 2019-12-22 11:15:15
问题 I would like to open the application settings by clicking on a preferences entry. So I added an intent to the preferences.xml <PreferenceScreen android:key="DELETE_DATA" android:title="@string/pref_delete_data"> <intent android:action="android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS"/> </PreferenceScreen> and I've added an Intent-filter to the AndroidManifest.xml <activity android:name=".SettingsActivity" android:label="@string/title_activity_settings" android:parentActivityName

Is it possible to hide a particular application from user?

和自甴很熟 提交于 2019-12-22 11:11:48
问题 I want to create the application that lists all install applications in my device. And After that I want to set it as Hide and Show With which another User can not able to see that particular application. So is it possible ? If yes, then How? 回答1: Yes, if you don't add the following in your main activity's declaration in android manifest: <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> by doing