android-activity

How to leave the current app and launch an activity of another app?

泄露秘密 提交于 2021-01-29 09:03:08
问题 I have a simple Android app that needs to launch another app under certain condition, and I will need to check the condition upon the app launch. That is, either continue to launch my app or just launch another app: if (A == true) { launch another activity of another app leave the current app without creating the main activity } else { launch the main activity of the current app } Could anyone please let me know how to deal with A == true case? I am able to launch another app's activity but I

How to send Text View data from 1st activity to 3rd activity

假如想象 提交于 2021-01-29 08:23:24
问题 I'm developing a project where I have 3 activities. Each activity has got it's own button which when clicked starts the next activity. 1st activity has got a Text View which displays Random String. When I press the button in 1st activity, 2nd activity will start. When i press the button in 2nd activity, 3rd activity is started. But I want to know how to send the random string from 1st activity to 3rd activity. First Activity: import android.content.Intent; import android.support.v7.app

Handling Permissions: Making one activity of a large app into an instant app

给你一囗甜甜゛ 提交于 2021-01-29 07:11:05
问题 I have been asked to make an instant app module openable from play store in a base app which I am working on. The base app is large with lots of activities. It also uses many more permissions than those allowed for instant apps. Is it possible that I make the instant app module from only one of the activities which utilizes only the allowed permissions? If yes, how should I go about it? In other words, can I declare the allowed permissions in the manifest file of the instant app module

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

Not Working corss-application activities with taskAffinity in Android 11

一笑奈何 提交于 2021-01-28 20:24:49
问题 I have two application, App A and App B, now I want to start an activity in App B from App A, the launchmode of this Activity is “singleTask”. The order: Activity X (App A) ———> Activity Y (App B) ———> Activity Z (App B, launchMode=“singleTask”) As default AndroidManifest config, there will be two App shown in the Task Manager, I hope users can only see App A label in Task Manager, so when they switch between tasks they don’t click App B. Before Android 11(Android R), I use the attribute

Starting new activity from onOptionsItemSelected

a 夏天 提交于 2021-01-28 19:23:45
问题 I am trying to start a new activity(Settings Activity) from onOptionsItemSelected, but i am getting fatal exception when i click on option two it starts settings activity for a while than it crashes. if i start Settings Activity from any where else than it starts without any error. SettingsActivity import android.os.Bundle; import android.app.Activity; import android.view.Menu; public class SettingsActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) {

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>

Converting an entire layout to an image/bitmap

和自甴很熟 提交于 2021-01-28 14:40:32
问题 I have been having an issue with this one line of code for a while and I would really apreciate it if any of you have ideaas about it. What I am trying to do is, save a specific layout( in this case a relative layout) as an image when a person hits a button. this action will transfer the image to the next activity. I'm pretty sure the actual act of transfering is not the problem. It's how I'm converting the layout to an image. below is the code with comments: Here is whats on activity1 //

How to change the int value onclick and pass it to another activity ? on android?

隐身守侯 提交于 2021-01-28 12:10:38
问题 I want to change (int x) when i click on (button x) and pass int x value to another activity. and change (int y) when i click on (button y) and pass int y value to another activity. how to do that on android ? 回答1: I want to change (int x) when i click on (button x) this is trivial, you create listener for your button and inside it you alter your variable x (defined in your activity A) and pass int x value to another activity. you need to put this x value inside Intent bundle and change (int

Is there anyway to get the position of android menubar item?

﹥>﹥吖頭↗ 提交于 2021-01-28 10:29:53
问题 I need to load Android dialog activity window once clicked on the icon in the action bar as displayed in the following image: I know how to load the window using the following code. resolver=getContentResolver(); layoutParams=getWindow().getAttributes(); layoutParams.x=400; layoutParams.height=600; layoutParams.width=1000; layoutParams.y= 30; this.getWindow().setAttributes(layoutParams); What I need to know is if there is any way to find out the position of the icon in action bar, without