start-activity

How I can use startActivity method from service in python kivy/jnius?

白昼怎懂夜的黑 提交于 2021-02-08 04:29:34
问题 I want to start an activity from a service in my android application (python 2.7 & kivy). I use startActivity method for it but it's not work. When I run the app and type "buildozer android logcat" , I see this: File "jnius_export_class.pxi", line 900, in jnius.jnius.JavaMultipleMethod.__ call__ (jnius/jnius.c:24581) JavaException: No methods matching your arguments Part of my service code: from jnius import autoclass, cast PythonService = autoclass("org.renpy.android.PythonService") activity

How pass data between activities using RxJava in android?

谁说我不能喝 提交于 2021-02-04 17:33:09
问题 I need to pass some data between two activities MainActivity and ChildActivity . Button click on MainActivity should open ChildActivity and send event with data. I have singleton: Subject<Object, Object> subject = new SerializedSubject<>(PublishSubject.create()); and in MainActivity I have the following button click handler: public void onClick(){ startActivity(new Intent(MainActivity.this, ChildActivity.class)); subject.onNext(new SomeEvent(data)); } and event listener subscription in

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

Can't start activity from BroadcastReceiver on android 10

陌路散爱 提交于 2020-01-25 08:53:10
问题 I updated my OS version to android 10 last night, and since then the startActivity function inside the broadcast receiver is doing nothing. This is how I try to start the activity based on the answer of CommonsWare: Intent i = new Intent(context, AlarmNotificationActivity.class); i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { // This is at least android 10... Log.d("Debug", "This is android 10"); // Start the

onActivityResult for Intent(Settings.ACTION_SETTINGS) called immediately

亡梦爱人 提交于 2020-01-23 10:08:44
问题 In my splash screen I have request to server, but when there's no internet connection i'm opening Intent settingsIntent = new Intent(Settings.ACTION_SETTINGS); startActivityForResult(settingsIntent, REQUEST_ENABLE_CONNECTION); But problem is that onActivityResult is called immediately with requestCode = REQUEST_ENABLE_CONNECTION I've also tried to add the flag FLAG_NEW_TASK for the intent with no luck. The activity is not singleTop or singleInstance in the manifest . What is the best android

Setting up Alarm Manager is creating 2 Instances of my Main Activity

被刻印的时光 ゝ 提交于 2020-01-19 06:16:32
问题 I have 2 activities, a Main Activity and SetAlarm Activity. I call SetAlarm Activity from Main. When I set up the alarm I create an instance of my main. How do I set up the alarm without creating another instance of the Main or do I kill the main before setting up the alarm? Quite new to this. I have read several of the alarm manager examples, but they all seem to set up a new intent and I think this is what is creating my 2 instances. Is this how you set up the alarm. It does go off. Here is

Setting up Alarm Manager is creating 2 Instances of my Main Activity

无人久伴 提交于 2020-01-19 06:11:26
问题 I have 2 activities, a Main Activity and SetAlarm Activity. I call SetAlarm Activity from Main. When I set up the alarm I create an instance of my main. How do I set up the alarm without creating another instance of the Main or do I kill the main before setting up the alarm? Quite new to this. I have read several of the alarm manager examples, but they all seem to set up a new intent and I think this is what is creating my 2 instances. Is this how you set up the alarm. It does go off. Here is

onActivityResult error

荒凉一梦 提交于 2020-01-06 08:23:25
问题 I have an activity that launches another one using startActivityForResult. This step is ok. Then the second activity has a map and when a button is clicked the geopoint coordinates are passed to a bundle that is used on first activity to fullfil an EditText. The function onActivityResult is runned until the end and then the program crashes and appears a message with "Source not found" on screen. This is the function on mapActivity: public void ConfirmLoc(View v){ double lat = loc

Start Android activity from list of activities

自闭症网瘾萝莉.ら 提交于 2020-01-03 04:38:08
问题 I am working on one android app, and in which i have one menu that shows list of Activity name.Upon clicking of any item from menu should start that specific Activity. One way i know to do this is, String classes[]= {"firstActivity","DetailActivity"}; intent i =new Intent(pkg_name+classes[position]);startActivity(i); where position=0 or 1. And for that i need to write in AndroidManifest.xml file below code for each Activity <activity android:name="com.example.day1.DetailActivity" > <intent

Wrong requestCode returned onActivityResult from another Activity

ぐ巨炮叔叔 提交于 2020-01-01 07:30:06
问题 I have an Activity that calls another Activity , that calls some other Activities . I send to the last Activity to get a result, and then i send back the result to the fist Activity . The flow is somthing like A -> B -> C -> D -> C -> B -> A With the flow from A to D is made of startActivityForResult and the flow from D to A is made of onActivityResult . From D to B the requestCode is always the same (the one I decided), but from B to A it suddenly change from my value to a random value (in