activity

MapFragment return null

匿名 (未验证) 提交于 2019-12-03 01:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: mMapFragment = ( SupportMapFragment ) getSupportFragmentManager () . findFragmentByTag ( MAP_FRAGMENT_TAG ); // We only create a fragment if it doesn't already exist. if ( mMapFragment == null ) { mMapFragment = SupportMapFragment . newInstance (); // Then we add it using a FragmentTransaction. FragmentTransaction fragmentTransaction = getSupportFragmentManager (). beginTransaction (); fragmentTransaction . add ( MapLay . getId (), mMapFragment , MAP_FRAGMENT_TAG ); fragmentTransaction . commit (); mMap = mMapFragment . getMap ();

Android - Activity that does not fill the parent screen

匿名 (未验证) 提交于 2019-12-03 01:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Any idea why this doesn't create an activity that looks like a popup instead of an activity that completely fills the screen? I assumed that I only needed to set the layout height and layout width to something other than "fill_parent", but it still shows up as a black screen that completely fills the screen. Ultimately, I simply want to create a popup, but I do not want to use an AlertDialog. Is this possible? 回答1: You must set your Activity's window to be floating. You can do this either by giving your activity the Dialog style defined by

Android - java.lang.SecurityException: Permission Denial: starting Intent

匿名 (未验证) 提交于 2019-12-03 01:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a library (jar) on build path of my project. The project accesses the MainActivity in the jar, using the following intent: final Intent it = new Intent(); it.setClassName("com.example.lib", "com.example.lib.MainActivity"); startActivity(it); It used to work for sometime, but suddenly started getting 'ActivityNotFoundException: No Activity found to handle Intent' which I was able to resolve. But now I am stuck with a 'java.lang.SecurityException: Permission Denial: starting Intent'. I have tried all suggestions made on stackoverflow

Fragment did not create a view

匿名 (未验证) 提交于 2019-12-03 01:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: MyFragment.java public class MyFragment extends Fragment { private onItemSelectedListener listener; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment, container, false); btn_myButton = (Button) view.findViewById(R.id.btn_new_client); btn_myButton .setOnClickListener(new OnClickListener() { public void onClick(View v) { updateDetail("New Layout"); } }); return view; } Button btn_myButton; public interface onItemSelectedListener { public

Android app fail to start after adding admob

匿名 (未验证) 提交于 2019-12-03 01:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm trying to implement admob in my app, but the app failed to start after I added it. This is the activity code: http://code.google.com/p/zhuang-dict/source/browse/trunk/ZhuangDict/src/cn/wangdazhuang/zdict/ZhuangDictActivity.java The main.xml: <? xml version = "1.0" encoding = "utf-8" ?> <LinearLayout xmlns:android = "http://schemas.android.com/apk/res/android" xmlns:ads = "http://schemas.android.com/apk/lib/com.google.ads" android:orientation = "vertical" android:layout_width = "fill_parent" android:layout_height = "fill_parent"

How to merge changes from a specific UCM activity from one ClearCase stream to another

匿名 (未验证) 提交于 2019-12-03 01:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: This should in theory be quite simple, i.e. merge the changes from a specific UCM activity from one stream to another. I had thought that I might just be able to use the Deliver command in the GUI and then select just the required activity to deliver, but it seems that the target stream is set to not allow deliveries from other streams. From searching the documentation it seems that I might instead be able to do this via the command line using the findmerge tool, but it's not at all clear from the rather sparse documentation how

Android: Unable to instantiate activity ComponentInfo

匿名 (未验证) 提交于 2019-12-03 01:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a problem on android developing app. I made a research first my error and i found out that there are other people who are having the same problem like me. I read all the comments a tried everything but still i'm having the same error. Here my error 05-29 12:39:36.701: E/AndroidRuntime(823): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.georgepanayi.mixfmcyprus.radio/com.georgepanayi.mixfmcyprus.radio.Main_Activity}: java.lang.ClassNotFoundException: Didn't find class "com.georgepanayi.mixfmcyprus.radio

How to hide Soft Keyboard when activity starts

匿名 (未验证) 提交于 2019-12-03 01:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have an Edittext with android:windowSoftInputMode="stateVisible" in Manifest. Now the keyboard will be shown when I start the activity. How to hide it? I cannot use android:windowSoftInputMode="stateHidden because when keyboard is visible then minimize the app and resume it the keyboard should be visible. I tried with InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0); but it did not work. 回答1: Use the following functions to show/hide the

java.lang.IllegalStateException: No activity

匿名 (未验证) 提交于 2019-12-03 01:06:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm building an Android app for which I'd like my first activity to be composed of 2 tabs, one for the user's profile, and one for the friends' activity. For these tabs, I opted for a TabHost since my Sherlock Action Bar is already using list navigation to move to other activities so I can't use tab navigation from the action bar. The app worked for a while, but now only one of my tabs works, as soon as I try to move to the second tab, I'm getting a java.lang.IllegalStateException: No activity I added the Logcat output for this error,

Android Overriding onBackPressed()

匿名 (未验证) 提交于 2019-12-03 01:06:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is it possible to override onBackPressed() for only one activity ? On back button click I want to call a dialog on a specific Activity, but in all other activities i want it to work as it worked before (going to previous activities) . . . Thanks For your anwsers in advance. EDITED Thank you everyone for your anwsers, I already had everything like you told me, but my problem was that when i was clicking back button on another Activity, I was going to my previous Activity (The one where i had back button Overriden) and i thought that it wasn't