start-activity

I can't start an activity from a broadcast receiver

余生长醉 提交于 2019-12-14 03:13:43
问题 I have a broadcast receiver from which, when it receives an intent, I would like to start/resume an activity. Up to point to start the activity everything works fine, I get the intent etc. But I cannot start my activity. Here is my android manifest: <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.imgzine.testing" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="16" /> <uses-permission android

unable to startActivity master-detail from another activity

感情迁移 提交于 2019-12-13 09:52:13
问题 I've an activity WelcomeActivity.java in which theres a button bContinue. In the OnClick method of the button, I tried this.. startActivity(new Intent(this, MenuItemDetailActivity.class)); //startActivity(new Intent("com.resto.demo.activity.MENUITEMLISTACTIVITY")); neither of the above 2 lines work. instead they give me NullPointerException & the program ends abruptly..I cant find the problem.. is the problem in manifest or my call? <activity android:name="com.resto.demo.activity

Is any alternate of Intent.FLAG_ACTIVITY_REORDER_TO_FRONT

六眼飞鱼酱① 提交于 2019-12-12 22:46:13
问题 I am creating Two activities as below now when click on button from MainActivity it shows SecondActivity and on click button from SecondActivity shows MainActivity normally but now on click soft back button Device show ANR. MainActivity buttonClick -> SecondActivity buttonClick -> Soft back click , results ANR. Is there any workaround? This issue with Android 4.4.4. I know about this https://code.google.com/p/android/issues/detail?id=63570#c2 issue. Thanks for any help. public class

Avoid loading data again when finishing activity

痴心易碎 提交于 2019-12-12 05:38:40
问题 In my main Activity of the app, I download some user data at the onStart() . When I open the Settings and I hit the Back button, I finish the Settings Activity and I return to the main Activity. The problem is that the data is being re-downloaded. So, how can avoid the re-downloading of data? I've though about startActivityForResult but I don't know how to use it and I do not understand how it works. Thank you in advance! 回答1: Define a static variable in your main activity class like this:

startActivity() does nothing even when the Intent is specified correctly

旧城冷巷雨未停 提交于 2019-12-12 03:06:38
问题 I am trying to open an activity from the launcher activity when an FCM-generated notification gets clicked. The startActivity function does nothing even when the log statement written above gets executed. Following are some relevant files/functions, please tell why is the ConversationDetailActivity not starting: The function which starts another activity from LoginActivity void handleNotificationClick() { if (getIntent().getExtras() != null) { for (String key : getIntent().getExtras().keySet(

onNewIntent not get called

北城余情 提交于 2019-12-11 04:55:38
问题 I have started a new activity of itself by calling start activity. But after the activity get started, in the method onNewIntent the finish() is not get called!!. WebActivity.java @Override protected void onNewIntent(Intent intent) { super.onNewIntent(intent); setIntent(intent); if (intent.getStringExtra("url") != null) { Intent intent1 = new Intent(getBaseContext(), WebActivity.class); intent1.putExtra("url",intent.getStringExtra("url")); startActivity(intent1); finish(); } } 回答1: FYI Debug

Widget stops responding to clicks (widget freezes)

会有一股神秘感。 提交于 2019-12-10 16:54:09
问题 I have simple app with widget. Widget works good for some time. After open and close another app (e.g. some game for the most cases) my widget stops responding to clicks. Do you know how to fix widget freezing please? I folowed some similar situation, but with no success: Android widget not responding to touches, Android widget buttons stop working, Android Widget stops working randomly, atc. My actual Widget.class: public class Widget extends AppWidgetProvider{ private DBManager dbManager;

onActivityResult in dialog fragment

我只是一个虾纸丫 提交于 2019-12-10 16:38:56
问题 I'm taking photo from dialog fragment. And also I need something like startActivityForResult(takePictureIntent, actionCode); @Override public void onActivityResult(int requestCode, int resultCode, Intent imageReturnedIntent) { super.onActivityResult(requestCode, resultCode, imageReturnedIntent); switch (requestCode) { case SELECT_PHOTO: getActivity(); if (resultCode == Activity.RESULT_OK) { Uri selectedImage = imageReturnedIntent.getData(); String[] filePathColumn = { MediaStore.Images.Media

Cannot find symbol method startActivity(android.content.Intent)

痴心易碎 提交于 2019-12-10 10:29:25
问题 I am a beginner in making android applications. I have made a web view which shows my web page. My web page consists contact buttons that i want to be opened in external apps like mail and dial. Therefore i got some help and got a code like this import android.app.Activity; import android.content.Intent; import android.net.MailTo; import android.net.Uri; import android.os.Bundle; import android.webkit.WebView; import android.webkit.WebViewClient; public class ourViewClient extends

Video free multi window size is not changed in android 7.1

风格不统一 提交于 2019-12-07 08:42:30
I'm working on free multi window in android 7.1 . With test application free multi window is working perfect.(please fine screenshot 1) Now Im playing video using MX player app, at that time free multi window size is not effecting.(please fine screenshot 2) String mxPlayer = "com.xx.xx.ad"; intent1 = new Intent(Intent.ACTION_VIEW); intent1.setPackage(mxPlayer); Uri videoUri = Uri.parse("http://xxx.75.135/Files/xxx/1_video/ideo.m3u"); intent1.setDataAndType(videoUri, "application/mp4"); startActivity(intent1, getActivityOptions(ApplicationType.CONTEXT_MENU).setLaunchBounds(new Rect(0, 0, 720,