android-activity

Activity is not assigned to Android.app.Activity Manifest XML

半城伤御伤魂 提交于 2020-01-04 01:20:11
问题 I am having some trouble with the fragment in Android Studio. So basically this is my MainActivity: public class MainActivity extends FragmentActivity { final Context context = this; ViewPager Tab; TabPagerAdapter TabAdapter; ActionBar actionBar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); TabAdapter = new TabPagerAdapter(getSupportFragmentManager()); Tab = (ViewPager) findViewById(R.id.pager); Tab

Intent extras not received

丶灬走出姿态 提交于 2020-01-04 00:29:06
问题 I am showing a notification from a library attached to my project, when clicked on the notification, the notification takes to an Activity (ReceivingActivity). Activity opens after clicking the notification ,but the extras attached to it are not received. Notification triggering code - I call sendNotification when i receive a gcm message and Notification code is in the library public static final int NOTIFICATION_ID = 1; private NotificationManager mNotificationManager; NotificationCompat

Launch an activity of an application from a different application on Android

ⅰ亾dé卋堺 提交于 2020-01-03 19:42:14
问题 I need to launch an activity (not the main activity) of an application from an application I have made. The activity I want to launch is proprietary, hence, I cannot make any changes to its code(or manifest). For example: I want to launch somebody's Facebook profile from my own application. A normal intent to facebook from my app would open the 'newsfeed'(which I don't want). I want to know how to access any other activity. Thanks in advance! The little code I have: String PACKAGE="com

Android:Use ButterKnife in Activity extending from another activity

假装没事ソ 提交于 2020-01-03 19:15:14
问题 I wanted navigation drawer in all my activities.So i used a BaseActivity for Navigation drawer and extended other activities from base activity.Base activity has Navigation drawers. Dashboard activity is extending base activity but it raises exception when i try to use butterknife to bind views saying java.lang.IllegalStateException: Required view 'dashboard_frameLayout' with ID 2131558517 for field 'frameLayout' was not found. here are the relevant files BaseActivity.java public class

Activity and JobIntentService Lifecycle

我怕爱的太早我们不能终老 提交于 2020-01-03 19:08:34
问题 I am running a JobIntentService to perform a task in background. The reason for using JobIntentService is that so that the user can minimize the screen while the operation is happening and even if the Android OS destroys the activity the JobIntentService will still keep running and if the user comes back he can be updated with the results. But I have a case in which suppose the user himself closes the app then I want to stop the JobIntentService also. Is there any way to notify the

How does Froyo display a Dialog atop the home screen?

[亡魂溺海] 提交于 2020-01-03 19:05:08
问题 I upgraded my Nexus One a few days ago with 2.2 (Froyo). This morning when I went to use it I saw a Dialog sitting atop the home/launcher screen notifying me that an update was available and that I could choose to upgrade now or later. My question is, what API mechanisms is this using to show a Dialog (perhaps an AlertDialog) atop the home screen? Having written an Android app, it was my understanding that Dialogs could only be shown atop an Activity, and that a Service cannot show a Dialog

How does Froyo display a Dialog atop the home screen?

懵懂的女人 提交于 2020-01-03 19:02:16
问题 I upgraded my Nexus One a few days ago with 2.2 (Froyo). This morning when I went to use it I saw a Dialog sitting atop the home/launcher screen notifying me that an update was available and that I could choose to upgrade now or later. My question is, what API mechanisms is this using to show a Dialog (perhaps an AlertDialog) atop the home screen? Having written an Android app, it was my understanding that Dialogs could only be shown atop an Activity, and that a Service cannot show a Dialog

Android: startActivityForResult not calling onActivityResult

纵饮孤独 提交于 2020-01-03 18:55:29
问题 My Setup A Service running in its own process, CentralService An activity that calls startActivityForResult(), MainActivity The activity that is being started for result, ReturnResultActivity What I'm trying to do Start ReturnResultActivity and have it bind to the service (register its handler) Let whatever other activities want to run run When it receives a message from the service: Unbind from the Service finish() setResult() Have the MainActivity's onActivityResult() method called Using

All icons of ActionMode Bar are not showing in Android?

送分小仙女□ 提交于 2020-01-03 16:59:13
问题 I have created a menu for my actionmode bar with icons but not all menu are showing with icon in actionmode bar. This is my menu xml file. <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/menu_archive" android:icon="@drawable/ic_action_file_archive" android:orderInCategory="100" android:title="@string/action_remove" app:showAsAction="always" /> <item android:id="@

Where to place setContentView() in onCreate()?

与世无争的帅哥 提交于 2020-01-03 12:17:18
问题 I am a beginner in android and I want to know why is it that when I place my setContentView() after defining the TextView , my app crashes , i.e protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); TextView tv=(TextView) findViewById(R.id.tv); Linkify.addLinks(tv, Linkify.WEB_URLS|Linkify.EMAIL_ADDRESSES| Linkify.PHONE_NUMBERS); setContentView(R.layout.activity_main); //After TextView } But when I put my setContentView() before defining the TextView then my