android-activity

Unable to select 'settings activity' in android studio

你说的曾经没有我的故事 提交于 2020-03-19 06:11:11
问题 I am following the tutorial (9.2), it asks to add a 'settings activity', when i try to select it, it is greyed out and says that it 'requires androidx support'. I can find no reference to androidx support in the tutorial and have tried googling the problem to no avail. I have even loaded the completed project from the master files to compare their code with mine, i can find no reference to androidx. I am using android studio 3.4.1 回答1: As it says, it requires androidx support. You need to

Unable to select 'settings activity' in android studio

不打扰是莪最后的温柔 提交于 2020-03-19 06:11:08
问题 I am following the tutorial (9.2), it asks to add a 'settings activity', when i try to select it, it is greyed out and says that it 'requires androidx support'. I can find no reference to androidx support in the tutorial and have tried googling the problem to no avail. I have even loaded the completed project from the master files to compare their code with mine, i can find no reference to androidx. I am using android studio 3.4.1 回答1: As it says, it requires androidx support. You need to

Fatal Exception: java.lang.RuntimeException: Unable to resume activity

人盡茶涼 提交于 2020-03-05 07:53:10
问题 Following is My Log Repost Fatal Exception: java.lang.RuntimeException: Unable to resume activity {com.maruticourier.android/com.marutideliver.activity.MainActivity}: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3069) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3098) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1350) at android.os

requestActivityTransitionUpdates never calls the registered BroadcastReceiver

醉酒当歌 提交于 2020-02-28 08:29:22
问题 I am coding a simple app that measures all available sensors of the android device (Wifi, BT, etc). One of them is the user activity (via ActivityRecognition API), but I can't make it works properly. I code a class to do everything related to user activity. I want to get only 4 states and one attribute to store the current one: var VEHICLE = "vehicle" var WALKING = "walking" var STILL = "still" var UNKNOWN = "unknown" private var current: String? = null It also includes a BroadcastReceiver

Forms.Context is obsolete so how should I get Activity of my single activity application?

☆樱花仙子☆ 提交于 2020-02-23 06:02:22
问题 For now I use this: var activity = (Activity)Forms.Context; But what I should use instead? According to accepted answer here I should use Android.App.Application.Context : Xamarin.Forms: Forms.Context is obsolete But I can't cast it into Activity . Is here any workaround? UPD : I need it to close application from library. 回答1: Solution one: Use CurrentActivityPlugin library. After setting up it correctly: var activity = CrossCurrentActivity.Current.Activity; Solution two: Define a static

How to open dialog styled activity from notification without previous activity closing?

别说谁变了你拦得住时间么 提交于 2020-02-22 05:44:48
问题 I have an Activity with dialog style so it visually opens on top of previous activity. I have a notification which opens this activity like this: Intent intent = new Intent(this, CalcActivity.class); PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); builder.setContentIntent(pendingIntent); ((NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE)).notify(0, builder.build()); The problem is that when user taps my

How to exclude from recents an exported activity?

半世苍凉 提交于 2020-02-20 08:18:21
问题 I have an app with an exported activity that can be invoked from other apps (Specifically the sharing action - android.intent.action.SEND ) How can an exported activity be excluded from recents? I don't see a way to set the FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS flag, because it is invoked from the outside. The reason I want to do this is because this intent becomes the last one in my activity stack, thus when clicking on the recents, a file is being re-shared instead of the main activity to pop

How to exclude from recents an exported activity?

心已入冬 提交于 2020-02-20 08:17:48
问题 I have an app with an exported activity that can be invoked from other apps (Specifically the sharing action - android.intent.action.SEND ) How can an exported activity be excluded from recents? I don't see a way to set the FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS flag, because it is invoked from the outside. The reason I want to do this is because this intent becomes the last one in my activity stack, thus when clicking on the recents, a file is being re-shared instead of the main activity to pop

Android: how do you disable that your app reopens when scanning a NFC tag?

依然范特西╮ 提交于 2020-02-20 05:43:29
问题 I'm writing an android application that reads data from a Mifare Classic card (4k). I have edited my AndroidManifest.xml file so that the app gets started (or I can choose another app that uses NFC). But when my app is openend and I hold my card next to my phone, it gives the popup again where I can choose which app to open. After some research I have found that I need to edit the function: onNewIntent , because this is the function that gets called when you scan a tag when your app is

Android deep linking - Back stack

旧巷老猫 提交于 2020-02-18 07:38:33
问题 I am trying to implement deep linking in my Android application. I have been following this guide. I have an Android Activity that is started from and intent-filter in the Android manifest: <activity android:name=".MyActivity" android:parentActivityName=".MainActivity" > <intent-filter android:label="@string/filter_title_deep_link"> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category