activity

The activity must be exported or contain an intent-filter

匿名 (未验证) 提交于 2019-12-03 02:00:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: when I tried to run my application its show the error below Error running Dashboard: The activity must be exported or contain an intent-filter How can I solve this error? 回答1: I changed the Select Run/Debug Configuration from my MainActivity to App and it started working. Select App configuration snapshot: 回答2: Double check your manifest, your first activity should have tag inside of activity tag. If that doesn't work, look for target build, which located in the left of run button (green-colored play button), it should be targeting "app"

How to update a TextView of an activity from another class

匿名 (未验证) 提交于 2019-12-03 02:00:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Iam new to android/java programming. I have two class, one is an activity and other normal class. In my activity class contains TextView. Can i update TextView of activity class from normal class. I tried with random code, but it fails. Please provide a solution... // activity class public class MainMenu extends Activity { public TextView txtView; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); TextView txtView = (TextView)findViewById(R.id.text); } } // other class public class ClassB { public

Detect 'home button pressed' event in android service displaying a UI (similar to facebook chatheads)

匿名 (未验证) 提交于 2019-12-03 01:58:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: In facebook chatheads, that are part of the facebook messenger app, I noticed the following behavior: As far as I can see, the chat head itself and the opened chat screen are all parts of a service. No activity is involved. How can I be sure? After I press home on the opened chat screen, it gets minimized back to a chat head, and I can immediately reopen the chat screen. If the chat screen was an activity, then reopening the activity via startActivity(intent) after the home button was pressed, would delay the start of the activity,

call activity method from broadcast receiver

匿名 (未验证) 提交于 2019-12-03 01:57:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In the main activity, a layout is loaded that has some input fields and a submit button. When the submit button is clicked, the onClick handler method sends an sms back to the same mobile number : SmsManager sms = SmsManager.getDefault(); sms.sendTextMessage(number, null, "hi", null, null); There is a broadcast receiver defined that intercepts the message : public class SmsReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Bundle pdusBundle = intent.getExtras(); Object[] pdus=(Object[]

Android :java.lang.SecurityException: Injecting to another application requires INJECT_EVENTS permission

匿名 (未验证) 提交于 2019-12-03 01:57:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Hi there I am new to Android Junit testing: I have written some test code in MainActivityFunctionalTest.java file MainActivityFunctionalTest.java: package com.example.myfirstapp2.test; public class MainActivityFunctionalTest extends ActivityInstrumentationTestCase2 { private static final String TAG = "MainActivityFunctionalTest"; private Login activity; public MainActivityFunctionalTest() { super(Login.class); } @Override protected void setUp() throws Exception { Log.d(TAG,"Set-Up"); super.setUp(); setActivityInitialTouchMode(false);

java.lang.RuntimeException: Unable to instantiate activity ComponentInfo

匿名 (未验证) 提交于 2019-12-03 01:57:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I was trying to run a sample code While launching the application in the android 1.5 emulator , I got these errors.... Any one have some hint..? ERROR from LogCat: 01 - 13 02 : 28 : 08.392 : ERROR / AndroidRuntime ( 2888 ): FATAL EXCEPTION : main 01 - 13 02 : 28 : 08.392 : ERROR / AndroidRuntime ( 2888 ): java . lang . RuntimeException : Unable to instantiate activity ComponentInfo { com . s . android . test / com . s . android . test . MainActivity }: java . lang . ClassNotFoundException : com . s . android . test . MainActivity

Activity has leaked window - Android

匿名 (未验证) 提交于 2019-12-03 01:55:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Look at these pieces of code: Custom views and window attributes on Android Problem When I click 'Home button', exception is thrown: Activity has leaked window... from this line: localWindowManager . addView ( colourView , layoutParams ); Question(s) Do you know what can cause it? Problem doesn't occur, when I close application with back button. Exception/Error Logs W / InputManagerService ( 96 ): Starting input on non - focused client com . android . internal . view . IInputMethodClient$Stub$Proxy@40908148 ( uid = 10056 pid = 1368

StrictMode activity instance count violation (2 instances, 1 expected) on rotation of completely empty activity

匿名 (未验证) 提交于 2019-12-03 01:55:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Relevant only in that it motivates eliminating any false positives from strict mode, since the continued presence of any makes the death penalty impractical Over the last few days I've been chasing down and fixing memory leaks in an application. On getting to the point that I believed I'd fixed them all, I implemented a fail-loud mechanism similar to that described in Android StrictMode and heap dumps (enable instance tracking with death penalty, intercept the shutdown error message, dump heap, send a distress signal next time application

Android Fragment getArguments() returns null

匿名 (未验证) 提交于 2019-12-03 01:54:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: As the title suggest. I've downloaded Fragment code from here, http://developer.android.com/shareables/training/FragmentBasics.zip . It is Fragment example from Android Official Developer site . http://developer.android.com/training/basics/fragments/fragment-ui.html This is the MainActivity.java 's onCreate() : /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.news_articles); // Check whether the activity is using the

Clear Activity Stack and start new activity in android

匿名 (未验证) 提交于 2019-12-03 01:54:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: My question is little bit different than these type of question. I need to remove or clear my activity stack then start a new activity. I don't think it is a clear_top flag problem. I am explaining with an example: My Activity flow : Login > Home > Screen1 > screen2 .... I finish Login activity or call with no_history flag. So my activities are look like this Login(finished)> Home [bottom of the stack now] > Screen1 > Screen2[top of the stack] I need to handle session error. If any session error occurs in any point i need to go back to login