forceclose

Adding android:layoutAnimation to a LinearLayout causes FC

自闭症网瘾萝莉.ら 提交于 2021-02-16 15:10:27
问题 I have the following XML in menu.xml, it's a LinearLayout that I need to animate, so I use the layoutAnimation property. Without this property the layout shows flawlesly, but with this property set I get a nasty forceclose and I don't understand why: <?xml version="1.0" encoding="utf-8"?> <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/bkgrnd" android:layoutAnimation="@anim/menu_anim" <=== adding

Force stop will make app's receiver not being called?

丶灬走出姿态 提交于 2020-01-14 12:19:48
问题 I have a service declared in XML that responds to PACKAGE_ADDED broadcast intent. It works fine, but I just found out that if I force stop the app, the receiver won't receive anything anymore. It's not being called. Is this normal? What can I do? I need to make sure it always responds. 回答1: Since version 3.1 of Android an application cant receive broadcast intents until its stared once manually. Before the first start, the application is considered as "Stopped" by the launcher. (http:/

java.lang.RuntimeException: start failed

只谈情不闲聊 提交于 2020-01-12 14:42:53
问题 I am trying to record audio in one of my Activities using MediaRecorder. Part of the code is shown below. File file = new File(AppConstants.MSGS_DIR, filename); MediaRecorder recorder = new MediaRecorder(); recorder.setAudioSource(AudioSource.MIC); recorder.setOutputFormat(OutputFormat.THREE_GPP); recorder.setAudioEncoder(AudioEncoder.AMR_WB); recorder.setOutputFile(file.getAbsolutePath()); try { recorder.prepare(); recorder.start(); } catch (IOException e) { System.out.println("Exception: "

java.lang.RuntimeException: start failed

为君一笑 提交于 2020-01-12 14:42:51
问题 I am trying to record audio in one of my Activities using MediaRecorder. Part of the code is shown below. File file = new File(AppConstants.MSGS_DIR, filename); MediaRecorder recorder = new MediaRecorder(); recorder.setAudioSource(AudioSource.MIC); recorder.setOutputFormat(OutputFormat.THREE_GPP); recorder.setAudioEncoder(AudioEncoder.AMR_WB); recorder.setOutputFile(file.getAbsolutePath()); try { recorder.prepare(); recorder.start(); } catch (IOException e) { System.out.println("Exception: "

Can't get bluetooth Adapter in Android

别说谁变了你拦得住时间么 提交于 2020-01-05 08:09:13
问题 I was trying to implement the bluetooth chat example given in the android samples. I am running it on a jelly beans device which has Android 4.1 version running on it . The application simply force closes. A part of launcher activity code of launcher activity goes like this. WHEN I COMMENT THE LINE "mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();" THE APPLICATION DOES NOT FORCE CLOSE. and all the toast messages are also displayed which are not with the line uncommented private

android tabHost brakes listviews onArticleSelected

折月煮酒 提交于 2020-01-01 07:04:34
问题 I have a Main Drawer activity which loads my fragments when a drawer item is selected. The fragment that is laoded contains a tabhost which hosts multiple fragments so you can switch to via tabs. Before Tabs I had a fragment with a bunch of butons that when clicked, replaced the current fragment with a new fragment. The fragments all have listviews in them, and when you click an item replaced the current listview fragment with another fragment. My problem is when I placed all my fragments

Android App ForceCloses on Starting of a new activity

試著忘記壹切 提交于 2019-12-25 04:21:40
问题 I am new to android development and I have been having issues with Force Close on new Android Activity Pages. My Structure is like this: Main Page -> Menu Page (Works Fine) -> New Game Screen(force closes) Call to the Activity: public void btnNewGame_Click(View view) { Intent i = new Intent(this, NewGameScreen.class); startActivityForResult(i, ACTIVITY_CREATE); } Manifest <activity android:name=".NewGameScreen" android:label="@string/app_name"> <intent-filter> <action android:name="android

FATAL EXCEPTION: main Unable to start activity ComponentInfo Caused by: java.lang.NullPointerException

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-25 02:42:36
问题 ERROR: FATAL EXCEPTION: main Unable to start activity ComponentInfo Caused by: `java.lang.NullPointerException` I'm not sure exactly why this is happening. It is crashing app on the line: listView.setOnVideoClickListener((VideoClickListener) this); I have my listview declared in my XML and my Java - so I'm not sure exactly what has gone wrong at this point LOGCAT: 12-04 15:37:10.563: E/AndroidRuntime(9470): FATAL EXCEPTION: main 12-04 15:37:10.563: E/AndroidRuntime(9470): java.lang

How to start Activity from Fragment? Android

泪湿孤枕 提交于 2019-12-25 02:37:07
问题 I am new to Android apps development. I use this open source sliding menu with fragments: http://www.androidhive.info/2013/11/android-sliding-menu-using-navigation-drawer/ I want to implement this rss feed parser (AndroidRssReader, also open source) in sliding menu project: http://android-er.blogspot.in/2010/04/simple-rss-reader-using-androids.html My idea is, that one of the sliding menu items (one fragment), starting an AndroidRssReader.java activity. I was put AndroidRssReader.java file in

Android application works fine in emulator but not in real device?

浪尽此生 提交于 2019-12-25 01:45:18
问题 I'm making a simple Music Player application. It already works perfectly on my emulator but after I install it on my device, it gives "The application MusicShare (process com.example.musicshare) has stopped unexpectedly. Please try again" . My device is a Galaxy S2 and I got the apk by taking it from the bin folder. I have tried using "Export w/o unsigned key and it cannot be installed instead. Here's the manifest : <manifest xmlns:android="http://schemas.android.com/apk/res/android" package=