Skip to content
Advertisement

Tag: android-activity

Why in Android documentation Activity classes have static modifier

If we open android documentation we will see that Activity classes have static modifier: I’m used to declaring Activities without static modifier: What is the reason behind using static modifier in Activity class declaration? UPDATE: The static modifiers have been removed from the documentation. Answer It’s Documentation bug. Sadly, they are not rare. You’d normally only use the static modifier

Android notification with RemoteViews – having activity associated with RemoteViews layout

I’ve been researching on how to create custom-layout notification using RemoteView. So far, I am able to create a notification with contentView and bigContentView pointing to a RemoteView with a custom layout xml. However, what does not happen, is to have Activity (associated with custom layout) started when this RemoteView is created. I’ve double checked and in my layout xml,

In Activity.onCreate(), why does Intent.getExtras() sometimes return null?

This was probably a false alarm, see my own answer. Original question below: An activity has a button that takes the user to another activity. To launch the new activity, we populate our Intent with extras, and onCreate(), the new activity reads from those extras via Intent.getExtras(). We assumed the returned bundle would be non-null, but as customer crash reports

Android Call a method from another class

I know that this Question is repeated but I can’t find the answer in the Internet. I want to call a method from another class. I have Class1 and Class2. In Class 2 I have this method: I want to call the above method from Class1. Thanks for any answer. —-EDIT—- —-LogCat— Answer You should use the following code :

How to start Activity in adapter?

I have a ListActivity with my customized adapter and inside each of the view, it may have some buttons, in which I need to implement OnClickListener. I need to implement the OnClickListener in the adapter. However, I don’t know how to call the function like startActivity() or setResult(). Since the adapter doesn’t extend to Activity. So what is the best

Advertisement