android-intent

How to stub Intent.createChooser Intent using Espresso

≡放荡痞女 提交于 2021-01-28 23:18:48
问题 Problem I have an image inside my app, and am sharing it to any other app that can handle image sharing, and the feature is working perectlty. I am writing an Espresso UI test to intercept the intent and ensure it has the correct action and extras, but cannot seem to get it to work. Code Here is the code when creating the intent: Intent intent = new Intent(Intent.ACTION_SEND); intent.putExtra(Intent.EXTRA_STREAM, uri); intent.setType(MediaType.PNG.toString()); startActivity(Intent

How to stub Intent.createChooser Intent using Espresso

℡╲_俬逩灬. 提交于 2021-01-28 23:11:43
问题 Problem I have an image inside my app, and am sharing it to any other app that can handle image sharing, and the feature is working perectlty. I am writing an Espresso UI test to intercept the intent and ensure it has the correct action and extras, but cannot seem to get it to work. Code Here is the code when creating the intent: Intent intent = new Intent(Intent.ACTION_SEND); intent.putExtra(Intent.EXTRA_STREAM, uri); intent.setType(MediaType.PNG.toString()); startActivity(Intent

How to start activity-alias of another app which has permission?

自古美人都是妖i 提交于 2021-01-28 22:23:57
问题 I have an app which has an activity and activity-alias. I am trying to call this activity from another app through activity-alias but it crashes when i add permission in activity-alias. If no permission is added, it works fine. <permission android:name="com.USE_SASETTINGS" android:protectionLevel="normal" /> <activity android:name=".DemoActivity" android:exported="true"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category

FullScreenIntent only appears if I clear the notification

こ雲淡風輕ζ 提交于 2021-01-28 22:06:58
问题 I'm trying to launch a FullScreenIntent from a service working in the background, but I realised that the intent would not be shown another time if I do not clear the notification from the task bar. I have tried removing the notification by removing .setSmallIcon(R.drawable.ic_launcher) .setContentTitle("Notification") .setContentText("A client is calling") but that just removes my option of clearing the notification. Can somebody help? My code is as shown: NotificationCompat.Builder mBuilder

FullScreenIntent only appears if I clear the notification

泄露秘密 提交于 2021-01-28 21:42:43
问题 I'm trying to launch a FullScreenIntent from a service working in the background, but I realised that the intent would not be shown another time if I do not clear the notification from the task bar. I have tried removing the notification by removing .setSmallIcon(R.drawable.ic_launcher) .setContentTitle("Notification") .setContentText("A client is calling") but that just removes my option of clearing the notification. Can somebody help? My code is as shown: NotificationCompat.Builder mBuilder

Call activity from another project

我只是一个虾纸丫 提交于 2021-01-28 19:05:15
问题 i want call project A to project B, but in project B used project C for library. I used the code in project A intent = new Intent("com.example.projectb.reading"); startActivity(intent); and AndroidManifest in project B <activity android:name="com.example.projectb.reading" android:label="Trainee" android:screenOrientation="portrait"> <intent-filter> <action android:name="com.xample.projecta.cls_show" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity>

Intent-filter for service start

China☆狼群 提交于 2021-01-28 18:52:52
问题 I want to start a service, the service is basically a videoview on windowmanager. I want to start this videoview service even from other applications. this is my code intent-filter, Don't know where I went wrong. <service android:name=".VideoWindow"> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:mimeType="video/*" /> <data android

Firebase signout is not leading to the correct activity

可紊 提交于 2021-01-28 09:00:55
问题 I tried to integrate an AlertDialog into my app via which the customer can log out. When I call up the dialog, it just works as it should be. However, if I press "log out" Iam not forwarded to the LoginActivity as requested. Instead, my dialog simply closes and the HomeActivity is reloaded. What am I doing wrong here? Greetings and thanks! private void signOut() { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle("Signout") .setMessage("Do you really want to sign

Firebase signout is not leading to the correct activity

烈酒焚心 提交于 2021-01-28 08:44:17
问题 I tried to integrate an AlertDialog into my app via which the customer can log out. When I call up the dialog, it just works as it should be. However, if I press "log out" Iam not forwarded to the LoginActivity as requested. Instead, my dialog simply closes and the HomeActivity is reloaded. What am I doing wrong here? Greetings and thanks! private void signOut() { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle("Signout") .setMessage("Do you really want to sign

My app crash as soon as I select a image?

你。 提交于 2021-01-28 06:46:57
问题 I am completely new to Android Studio and I have been trying to make an app that scans using the (:scanLibrary) given by this link and followed the instructions given here https://github.com/jhansireddy/AndroidScannerDemo. There is no compilation error but only some runtime error. Can someone help me figure out why this is happening? This is my code package com.mukesh.android.digiwrite; import android.app.Activity; import android.content.Intent; import android.graphics.Bitmap; import android