android-activity

How to make notification intent resume rather than making a new intent?

此生再无相见时 提交于 2020-05-19 08:30:26
问题 What i have here is a simple webview activity that when loaded it auto displays an ongoing notification. The idea is that people can navigate away from this activity and quickly access it again from any screen they want by pulling down the drop down menu and selecting it. Then when they want they can just close the notification by hitting the menu button and hitting exit and then the notification clears. This all works fine. However, when the notification is pressed it starts a new instance

How can I launch an independent activity to my application as well as the application of phone launches the activity to make calls?

落花浮王杯 提交于 2020-05-16 13:53:46
问题 I'm working on an application and I need to make it possible to launch an activity in a separate history and stack as you can see in the photo that the application of the telephone starts the activity to make calls that works independently and even this can be observed when I want See recent apps. 回答1: In the Manifest file for your application In the <activity> element Add an attribute: android:process=". ProcessName " This will cause that particular activity to be launched in a new process.

Create a custom view with Android Studio

蓝咒 提交于 2020-05-15 04:11:27
问题 I'm trying to make a little view in Android Studio that can drag it from right to left. This view will have 2 buttons. And when you select one of them or press outside of it, the small menu will hide again. I have been searching and I have not got any library that does something similar. I also have no idea how to do it. I can draw the small view in a separate view (layout xml) but I don't know how to add it and create the events to be opened or closed by dragging. How can I do this? Thanks.

Create a custom view with Android Studio

送分小仙女□ 提交于 2020-05-15 04:10:12
问题 I'm trying to make a little view in Android Studio that can drag it from right to left. This view will have 2 buttons. And when you select one of them or press outside of it, the small menu will hide again. I have been searching and I have not got any library that does something similar. I also have no idea how to do it. I can draw the small view in a separate view (layout xml) but I don't know how to add it and create the events to be opened or closed by dragging. How can I do this? Thanks.

Create a custom view with Android Studio

南楼画角 提交于 2020-05-15 04:10:01
问题 I'm trying to make a little view in Android Studio that can drag it from right to left. This view will have 2 buttons. And when you select one of them or press outside of it, the small menu will hide again. I have been searching and I have not got any library that does something similar. I also have no idea how to do it. I can draw the small view in a separate view (layout xml) but I don't know how to add it and create the events to be opened or closed by dragging. How can I do this? Thanks.

How to call a non-static method from one Activity to another activity

做~自己de王妃 提交于 2020-05-10 14:58:32
问题 I have two activities & i want to call a method clear from B. I tried like this and I am getting null pointer exceptions. class A extends Activity { ... public void clear(){} } class B extends Activity{ public void clearData() { A a=new A(); a.clear(); } } 回答1: class A extends Activity{ static A instance; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); instance = this; } public static A getInstance() { return instance; } .... public void

Bad window token, you cannot show a dialog before an Activity is created or after it's hidden

谁都会走 提交于 2020-05-09 20:06:42
问题 I am using an AppIntro library in my app. It has 3 slides. I want to ask the user something when the third slide is shown. To achieve that I am using material dialogs by afollestad. My code in the AppIntro Activity looks like that: @Override public void onNextPressed() { if(this.pager.getCurrentItem() == 2) { MaterialDialog dialog = new MaterialDialog.Builder(getApplicationContext()) .title("QR Code scannen") .content("Möchtest du den QR Code scannen oder selbst eingeben?") .positiveText(

Bad window token, you cannot show a dialog before an Activity is created or after it's hidden

醉酒当歌 提交于 2020-05-09 20:06:03
问题 I am using an AppIntro library in my app. It has 3 slides. I want to ask the user something when the third slide is shown. To achieve that I am using material dialogs by afollestad. My code in the AppIntro Activity looks like that: @Override public void onNextPressed() { if(this.pager.getCurrentItem() == 2) { MaterialDialog dialog = new MaterialDialog.Builder(getApplicationContext()) .title("QR Code scannen") .content("Möchtest du den QR Code scannen oder selbst eingeben?") .positiveText(

Bad window token, you cannot show a dialog before an Activity is created or after it's hidden

我的未来我决定 提交于 2020-05-09 20:06:00
问题 I am using an AppIntro library in my app. It has 3 slides. I want to ask the user something when the third slide is shown. To achieve that I am using material dialogs by afollestad. My code in the AppIntro Activity looks like that: @Override public void onNextPressed() { if(this.pager.getCurrentItem() == 2) { MaterialDialog dialog = new MaterialDialog.Builder(getApplicationContext()) .title("QR Code scannen") .content("Möchtest du den QR Code scannen oder selbst eingeben?") .positiveText(

Activity life cycle methods : onPostResume significance

依然范特西╮ 提交于 2020-05-09 19:32:23
问题 Official documentation about Activity lists out 7 life cycle methods. onPostResume() was not quoted as life cycle method. But I feel that this method is important method. During the life cycle, when an activity is visible from hidden to show state, onRestart() onStart() onResume() onPostResume() have been invoked in order. My code snippet: package ravindra.projects.my_app_1; import android.content.Intent; import android.content.IntentFilter; import android.os.PersistableBundle; import android