BlackjackGTV sample - OutOfMemory - android

I'm trying to get the Blackjack Google TV sample working on a Vizio Co-Star (Google TV). I downloaded the sample code from https://code.google.com/p/googletv-android-samples/ but when I deploy it to the Vizio, I get an OutOfMemory error.
Has anyone gotten the Blackjack GTV sample working?
Full Stack Trace:
04-02 13:32:56.364: E/dalvikvm-heap(4027): Out of memory on a 78655376-byte allocation.
04-02 13:32:56.374: E/AndroidRuntime(4027): FATAL EXCEPTION: main
04-02 13:32:56.374: E/AndroidRuntime(4027): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.google.android.tv.blackjack/com.google.android.tv.blackjack.BlackJackTableActivity}: android.view.InflateException: Binary XML file line #17: Error inflating class
04-02 13:32:56.374: E/AndroidRuntime(4027): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1836)
04-02 13:32:56.374: E/AndroidRuntime(4027): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1852)
04-02 13:32:56.374: E/AndroidRuntime(4027): at android.app.ActivityThread.access$500(ActivityThread.java:124)
04-02 13:32:56.374: E/AndroidRuntime(4027): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1038)
04-02 13:32:56.374: E/AndroidRuntime(4027): at android.os.Handler.dispatchMessage(Handler.java:99)
04-02 13:32:56.374: E/AndroidRuntime(4027): at android.os.Looper.loop(Looper.java:132)
04-02 13:32:56.374: E/AndroidRuntime(4027): at android.app.ActivityThread.main(ActivityThread.java:4196)
04-02 13:32:56.374: E/AndroidRuntime(4027): at java.lang.reflect.Method.invokeNative(Native Method)
04-02 13:32:56.374: E/AndroidRuntime(4027): at java.lang.reflect.Method.invoke(Method.java:491)
04-02 13:32:56.374: E/AndroidRuntime(4027): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
04-02 13:32:56.374: E/AndroidRuntime(4027): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
04-02 13:32:56.374: E/AndroidRuntime(4027): at dalvik.system.NativeStart.main(Native Method)
04-02 13:32:56.374: E/AndroidRuntime(4027): Caused by: android.view.InflateException: Binary XML file line #17: Error inflating class
04-02 13:32:56.374: E/AndroidRuntime(4027): at android.view.LayoutInflater.createView(LayoutInflater.java:596)
04-02 13:32:56.374: E/AndroidRuntime(4027): at com.android.internal.policy.impl.tv.TvLayoutInflater.onCreateView(TvLayoutInflater.java:50)
04-02 13:32:56.374: E/AndroidRuntime(4027): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:644)
04-02 13:32:56.374: E/AndroidRuntime(4027): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:669)
04-02 13:32:56.374: E/AndroidRuntime(4027): at android.view.LayoutInflater.inflate(LayoutInflater.java:457)
04-02 13:32:56.374: E/AndroidRuntime(4027): at android.view.LayoutInflater.inflate(LayoutInflater.java:391)
04-02 13:32:56.374: E/AndroidRuntime(4027): at android.view.LayoutInflater.inflate(LayoutInflater.java:347)
04-02 13:32:56.374: E/AndroidRuntime(4027): at com.android.internal.policy.impl.tv.TvWindow.setContentView(TvWindow.java:248)
04-02 13:32:56.374: E/AndroidRuntime(4027): at android.app.Activity.setContentView(Activity.java:1809)
04-02 13:32:56.374: E/AndroidRuntime(4027): at com.google.android.tv.blackjack.BlackJackTableActivity.onCreate(BlackJackTableActivity.java:58)
04-02 13:32:56.374: E/AndroidRuntime(4027): at android.app.Activity.performCreate(Activity.java:4438)
04-02 13:32:56.374: E/AndroidRuntime(4027): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
04-02 13:32:56.374: E/AndroidRuntime(4027): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1800)
04-02 13:32:56.374: E/AndroidRuntime(4027): ... 11 more
04-02 13:32:56.374: E/AndroidRuntime(4027): Caused by: java.lang.reflect.InvocationTargetException
04-02 13:32:56.374: E/AndroidRuntime(4027): at java.lang.reflect.Constructor.constructNative(Native Method)
04-02 13:32:56.374: E/AndroidRuntime(4027): at java.lang.reflect.Constructor.newInstance(Constructor.java:416)
04-02 13:32:56.374: E/AndroidRuntime(4027): at android.view.LayoutInflater.createView(LayoutInflater.java:576)
04-02 13:32:56.374: E/AndroidRuntime(4027): ... 23 more
04-02 13:32:56.374: E/AndroidRuntime(4027): Caused by: java.lang.OutOfMemoryError
04-02 13:32:56.374: E/AndroidRuntime(4027): at android.graphics.Bitmap.nativeCreate(Native Method)
04-02 13:32:56.374: E/AndroidRuntime(4027): at android.graphics.Bitmap.createBitmap(Bitmap.java:604)
04-02 13:32:56.374: E/AndroidRuntime(4027): at android.graphics.Bitmap.createBitmap(Bitmap.java:551)
04-02 13:32:56.374: E/AndroidRuntime(4027): at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:437)
04-02 13:32:56.374: E/AndroidRuntime(4027): at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:524)
04-02 13:32:56.374: E/AndroidRuntime(4027): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:499)
04-02 13:32:56.374: E/AndroidRuntime(4027): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:351)
04-02 13:32:56.374: E/AndroidRuntime(4027): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:738)
04-02 13:32:56.374: E/AndroidRuntime(4027): at android.content.res.Resources.loadDrawable(Resources.java:1918)
04-02 13:32:56.374: E/AndroidRuntime(4027): at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
04-02 13:32:56.374: E/AndroidRuntime(4027): at android.view.View.(View.java:2477)
04-02 13:32:56.374: E/AndroidRuntime(4027): at android.view.ViewGroup.(ViewGroup.java:379)
04-02 13:32:56.374: E/AndroidRuntime(4027): at android.widget.FrameLayout.(FrameLayout.java:94)
04-02 13:32:56.374: E/AndroidRuntime(4027): at android.widget.FrameLayout.(FrameLayout.java:90)
04-02 13:32:56.374: E/AndroidRuntime(4027): ... 26 more

If you open the layout file and remove the android:background="#drawable/green_background" from the source then it will work for you. There was a memory partition change recently and the sample has not been updated to reduce its memory footprint (eg. Big Bitmap image)

Related

UnityPlayerActivity oncreate errors

I am trying to run very simple program which start with:
MainActivity extends UnityPlayerActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
But on the on create i get this error:
04-02 09:38:39.227: E/AndroidRuntime(32578): Device fingerprint: samsung/GT-I9100/GT-I9100:4.1.2/JZO54K/I9100XWLSW:user/release-keys
04-02 09:38:39.227: E/AndroidRuntime(32578): Caused by:java.lang.ExceptionInInitializerError
04-02 09:38:39.227: E/AndroidRuntime(32578): at com.unity3d.player.UnityPlayerActivity.onCreate(Unknown Source)
04-02 09:38:39.227: E/AndroidRuntime(32578): at com.example.t.MainActivity.onCreate(MainActivity.java:17)
04-02 09:38:39.227: E/AndroidRuntime(32578): at android.app.Activity.performCreate(Activity.java:5206)
04-02 09:38:39.227: E/AndroidRuntime(32578): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
04-02 09:38:39.227: E/AndroidRuntime(32578): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2074)
04-02 09:38:39.227: E/AndroidRuntime(32578): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load main: findLibrary returned null
04-02 09:38:39.227: E/AndroidRuntime(32578): at java.lang.Runtime.loadLibrary(Runtime.java:365)
04-02 09:38:39.227: E/AndroidRuntime(32578): at java.lang.System.loadLibrary(System.java:535)
04-02 09:38:39.227: E/AndroidRuntime(32578): at com.unity3d.player.UnityPlayer.<clinit>(Unknown Source)
I use compiler 1.6 and took the jar - classes.jar from the unity folder
What can be wrong?
I think the problem is in the manifest.
Come here and follow the instructions!

Android Google Map API V2 - Error Inflating Class Fragment

I have been following Googles guide to making an app that allows you to view an app on an Android phone. I have followed many tutorials, but always end up with the same error! I have also searched around the web and figured my error is something to do with the "fragment". Here are my files:
MainActivity.java
package com.example.theapp;
import android.app.Activity;
import android.os.Bundle;
public class MainActivity extends Activity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.google.android.gms.maps.MapFragment"/>
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.theapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />
<permission
android:name="com.example.theapp.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="com.example.theapp.permission.MAPS_RECEIVE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<!-- The following two permissions are not required to use
Google Maps Android API v2, but are recommended. -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="--REMOVED--"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.theapp.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
</application>
I am using Android 2.3. Here is the log cat messages:
04-02 22:43:45.890: D/AndroidRuntime(23773): Shutting down VM
04-02 22:43:45.890: W/dalvikvm(23773): threadid=1: thread exiting with uncaught exception (group=0x40018578)
04-02 22:43:45.898: E/AndroidRuntime(23773): FATAL EXCEPTION: main
04-02 22:43:45.898: E/AndroidRuntime(23773): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.theapp/com.example.theapp.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
04-02 22:43:45.898: E/AndroidRuntime(23773): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
04-02 22:43:45.898: E/AndroidRuntime(23773): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
04-02 22:43:45.898: E/AndroidRuntime(23773): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
04-02 22:43:45.898: E/AndroidRuntime(23773): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
04-02 22:43:45.898: E/AndroidRuntime(23773): at android.os.Handler.dispatchMessage(Handler.java:99)
04-02 22:43:45.898: E/AndroidRuntime(23773): at android.os.Looper.loop(Looper.java:130)
04-02 22:43:45.898: E/AndroidRuntime(23773): at android.app.ActivityThread.main(ActivityThread.java:3687)
04-02 22:43:45.898: E/AndroidRuntime(23773): at java.lang.reflect.Method.invokeNative(Native Method)
04-02 22:43:45.898: E/AndroidRuntime(23773): at java.lang.reflect.Method.invoke(Method.java:507)
04-02 22:43:45.898: E/AndroidRuntime(23773): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
04-02 22:43:45.898: E/AndroidRuntime(23773): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
04-02 22:43:45.898: E/AndroidRuntime(23773): at dalvik.system.NativeStart.main(Native Method)
04-02 22:43:45.898: E/AndroidRuntime(23773): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
04-02 22:43:45.898: E/AndroidRuntime(23773): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:581)
04-02 22:43:45.898: E/AndroidRuntime(23773): at android.view.LayoutInflater.inflate(LayoutInflater.java:386)
04-02 22:43:45.898: E/AndroidRuntime(23773): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
04-02 22:43:45.898: E/AndroidRuntime(23773): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
04-02 22:43:45.898: E/AndroidRuntime(23773): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:209)
04-02 22:43:45.898: E/AndroidRuntime(23773): at android.app.Activity.setContentView(Activity.java:1657)
04-02 22:43:45.898: E/AndroidRuntime(23773): at com.example.theapp.MainActivity.onCreate(MainActivity.java:11)
04-02 22:43:45.898: E/AndroidRuntime(23773): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-02 22:43:45.898: E/AndroidRuntime(23773): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
04-02 22:43:45.898: E/AndroidRuntime(23773): ... 11 more
04-02 22:43:45.898: E/AndroidRuntime(23773): Caused by: java.lang.ClassNotFoundException: android.view.fragment in loader dalvik.system.PathClassLoader[/data/app/com.example.theapp-1.apk]
04-02 22:43:45.898: E/AndroidRuntime(23773): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
04-02 22:43:45.898: E/AndroidRuntime(23773): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
04-02 22:43:45.898: E/AndroidRuntime(23773): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
04-02 22:43:45.898: E/AndroidRuntime(23773): at android.view.LayoutInflater.createView(LayoutInflater.java:471)
04-02 22:43:45.898: E/AndroidRuntime(23773): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:549)
04-02 22:43:45.898: E/AndroidRuntime(23773): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
04-02 22:43:45.898: E/AndroidRuntime(23773): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
04-02 22:43:45.898: E/AndroidRuntime(23773): ... 19 more
04-02 22:55:53.289: D/AndroidRuntime(23942): Shutting down VM
04-02 22:55:53.289: W/dalvikvm(23942): threadid=1: thread exiting with uncaught exception (group=0x40018578)
04-02 22:55:53.304: E/AndroidRuntime(23942): FATAL EXCEPTION: main
04-02 22:55:53.304: E/AndroidRuntime(23942): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.theapp/com.example.theapp.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
04-02 22:55:53.304: E/AndroidRuntime(23942): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
04-02 22:55:53.304: E/AndroidRuntime(23942): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
04-02 22:55:53.304: E/AndroidRuntime(23942): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
04-02 22:55:53.304: E/AndroidRuntime(23942): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
04-02 22:55:53.304: E/AndroidRuntime(23942): at android.os.Handler.dispatchMessage(Handler.java:99)
04-02 22:55:53.304: E/AndroidRuntime(23942): at android.os.Looper.loop(Looper.java:130)
04-02 22:55:53.304: E/AndroidRuntime(23942): at android.app.ActivityThread.main(ActivityThread.java:3687)
04-02 22:55:53.304: E/AndroidRuntime(23942): at java.lang.reflect.Method.invokeNative(Native Method)
04-02 22:55:53.304: E/AndroidRuntime(23942): at java.lang.reflect.Method.invoke(Method.java:507)
04-02 22:55:53.304: E/AndroidRuntime(23942): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
04-02 22:55:53.304: E/AndroidRuntime(23942): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
04-02 22:55:53.304: E/AndroidRuntime(23942): at dalvik.system.NativeStart.main(Native Method)
04-02 22:55:53.304: E/AndroidRuntime(23942): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
04-02 22:55:53.304: E/AndroidRuntime(23942): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:581)
04-02 22:55:53.304: E/AndroidRuntime(23942): at android.view.LayoutInflater.inflate(LayoutInflater.java:386)
04-02 22:55:53.304: E/AndroidRuntime(23942): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
04-02 22:55:53.304: E/AndroidRuntime(23942): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
04-02 22:55:53.304: E/AndroidRuntime(23942): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:209)
04-02 22:55:53.304: E/AndroidRuntime(23942): at android.app.Activity.setContentView(Activity.java:1657)
04-02 22:55:53.304: E/AndroidRuntime(23942): at com.example.theapp.MainActivity.onCreate(MainActivity.java:11)
04-02 22:55:53.304: E/AndroidRuntime(23942): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-02 22:55:53.304: E/AndroidRuntime(23942): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
04-02 22:55:53.304: E/AndroidRuntime(23942): ... 11 more
04-02 22:55:53.304: E/AndroidRuntime(23942): Caused by: java.lang.ClassNotFoundException: android.view.fragment in loader dalvik.system.PathClassLoader[/data/app/com.example.theapp-2.apk]
04-02 22:55:53.304: E/AndroidRuntime(23942): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
04-02 22:55:53.304: E/AndroidRuntime(23942): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
04-02 22:55:53.304: E/AndroidRuntime(23942): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
04-02 22:55:53.304: E/AndroidRuntime(23942): at android.view.LayoutInflater.createView(LayoutInflater.java:471)
04-02 22:55:53.304: E/AndroidRuntime(23942): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:549)
04-02 22:55:53.304: E/AndroidRuntime(23942): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
04-02 22:55:53.304: E/AndroidRuntime(23942): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
04-02 22:55:53.304: E/AndroidRuntime(23942): ... 19 more
Any help would be appreciated. Thank you in advance.
package com.example.theapp;
import android.app.Activity;
import android.os.Bundle;
public class MainActivity extends FragmentActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
and in manifest add one more meta tag below previous one.
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="Api key" />
As far as I remember, You should include android-support-v4.jar file from Android SDK folder "sdk/extras/android/support/v4/android-support-v4.jar". If You dont have that file, in Your SDK Manager install Android Support Library, which is found under Extras.
Please check the following steps:
In android manifest you have the NETWORK STATE permission like this
< uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
In android manifest make sure you have the following code as well-
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value=" YOUR KEY HERE" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
Lastly if you are testing your application on android API 5.x then make sure you modify your map code like this-
Instead of this
map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();
write this
map = getMapFragment().getMap();
and add a small method like this
private MapFragment getMapFragment() {
FragmentManager fm = null;
Log.d("", "sdk: " + Build.VERSION.SDK_INT);
Log.d("", "release: " + Build.VERSION.RELEASE);
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
Log.d("", "using getFragmentManager");
fm = getFragmentManager();
} else {
Log.d("", "using getChildFragmentManager");
fm = getChildFragmentManager();
}
return (MapFragment) fm.findFragmentById(R.id.map);
}
And make sure for step 3 your min sdk version in your manifest file is 17 like this
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="21" />

How should i use a jar library in my android layout?

I make the jar library in my code successfully, but in my xml file it calls
06-08 18:55:23.715: E/AndroidRuntime(13218): java.lang.RuntimeException: Unable to start activity ComponentInfo: android.view.InflateException: Binary XML file line #6: Error inflating class android.jar.com.jjoe64.graphview.BarGraphView
exception.
And the jar file is here github-jjoe64/GraphView
06-08 19:46:22.023: E/AndroidRuntime(19764): FATAL EXCEPTION: main
06-08 19:46:22.023: E/AndroidRuntime(19764): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.zxl.Timetable/com.zxl.Timetable.ui.CurriculumAllInfo}: android.view.InflateException: Binary XML file line #6: Error inflating class com.jjoe64.graphview.BarGraphView
06-08 19:46:22.023: E/AndroidRuntime(19764): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2307)
06-08 19:46:22.023: E/AndroidRuntime(19764): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2357)
06-08 19:46:22.023: E/AndroidRuntime(19764): at android.app.ActivityThread.access$600(ActivityThread.java:153)
06-08 19:46:22.023: E/AndroidRuntime(19764): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1247)
06-08 19:46:22.023: E/AndroidRuntime(19764): at android.os.Handler.dispatchMessage(Handler.java:99)
06-08 19:46:22.023: E/AndroidRuntime(19764): at android.os.Looper.loop(Looper.java:137)
06-08 19:46:22.023: E/AndroidRuntime(19764): at android.app.ActivityThread.main(ActivityThread.java:5226)
06-08 19:46:22.023: E/AndroidRuntime(19764): at java.lang.reflect.Method.invokeNative(Native Method)
06-08 19:46:22.023: E/AndroidRuntime(19764): at java.lang.reflect.Method.invoke(Method.java:511)
06-08 19:46:22.023: E/AndroidRuntime(19764): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
06-08 19:46:22.023: E/AndroidRuntime(19764): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562)
06-08 19:46:22.023: E/AndroidRuntime(19764): at dalvik.system.NativeStart.main(Native Method)
06-08 19:46:22.023: E/AndroidRuntime(19764): Caused by: android.view.InflateException: Binary XML file line #6: Error inflating class com.jjoe64.graphview.BarGraphView
06-08 19:46:22.023: E/AndroidRuntime(19764): at android.view.LayoutInflater.createView(LayoutInflater.java:596)
06-08 19:46:22.023: E/AndroidRuntime(19764): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
06-08 19:46:22.023: E/AndroidRuntime(19764): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
06-08 19:46:22.023: E/AndroidRuntime(19764): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
06-08 19:46:22.023: E/AndroidRuntime(19764): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
06-08 19:46:22.023: E/AndroidRuntime(19764): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
06-08 19:46:22.023: E/AndroidRuntime(19764): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:270)
06-08 19:46:22.023: E/AndroidRuntime(19764): at android.app.Activity.setContentView(Activity.java:1881)
06-08 19:46:22.023: E/AndroidRuntime(19764): at com.zxl.Timetable.ui.CurriculumAllInfo.onCreate(CurriculumAllInfo.java:39)
06-08 19:46:22.023: E/AndroidRuntime(19764): at android.app.Activity.performCreate(Activity.java:5104)
06-08 19:46:22.023: E/AndroidRuntime(19764): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
06-08 19:46:22.023: E/AndroidRuntime(19764): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2261)
06-08 19:46:22.023: E/AndroidRuntime(19764): ... 11 more
06-08 19:46:22.023: E/AndroidRuntime(19764): Caused by: java.lang.NoSuchMethodException: <init> [class android.content.Context, interface android.util.AttributeSet]
06-08 19:46:22.023: E/AndroidRuntime(19764): at java.lang.Class.getConstructorOrMethod(Class.java:460)
06-08 19:46:22.023: E/AndroidRuntime(19764): at java.lang.Class.getConstructor(Class.java:431)
06-08 19:46:22.023: E/AndroidRuntime(19764): at android.view.LayoutInflater.createView(LayoutInflater.java:561)
06-08 19:46:22.023: E/AndroidRuntime(19764): ... 22 more
#jjoe64
create a folder
libs
in your project and add that jar file in it
Right Click that jar file
-->Build path-->Add to Build Path
The View that you are trying to use in the layout file needs to implement the two-parameter constructor that takes a Context and an AttributeSet, as that is the constructor used by the layout inflater. Your View does not, and hence it cannot be used in a layout XML resource.

Vibrator.vibrate(long) causing frequent application restarts on LG-E730

If I am using the Vibrator.vibrate(long) on an LG-E370 this is causing frequent application restarts. The vibrator permission has been added to the manifest and the vibrator vibrates up to 5 times before the app is restarting.
How can I vibrate reliably?
I added the output of a stacktrace to my onPause() and this is what I get:
04-02 14:39:36.384: dalvik.system.VMStack.getThreadStackTrace(Native Method)
04-02 14:39:36.384: java.lang.Thread.getStackTrace(Thread.java:737)
04-02 14:39:36.384: com.evotegra.aCoDriver.ACoDriverActivity.onPause(ACoDriverActivity.java:94)
04-02 14:39:36.384: android.app.Activity.performPause(Activity.java:3851)
04-02 14:39:36.384: android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1191)
04-02 14:39:36.424: android.app.ActivityThread.performNewIntents(ActivityThread.java:1747)
04-02 14:39:36.424: android.app.ActivityThread.handleNewIntent(ActivityThread.java:1757)
04-02 14:39:36.424: android.app.ActivityThread.access$2300(ActivityThread.java:117)
04-02 14:39:36.424: android.app.ActivityThread$H.handleMessage(ActivityThread.java:989)
04-02 14:39:36.424: android.os.Handler.dispatchMessage(Handler.java:99)
04-02 14:39:36.434: android.os.Looper.loop(Looper.java:130)
04-02 14:39:36.434: android.app.ActivityThread.main(ActivityThread.java:3740)
04-02 14:39:36.434: java.lang.reflect.Method.invokeNative(Native Method)
04-02 14:39:36.434: java.lang.reflect.Method.invoke(Method.java:507)
04-02 14:39:36.444: com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:880)
04-02 14:39:36.444: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:638)
04-02 14:39:36.444: dalvik.system.NativeStart.main(Native Method)
04-02 14:39:44.351: dalvik.system.VMStack.getThreadStackTrace(Native Method)
04-02 14:39:44.371: java.lang.Thread.getStackTrace(Thread.java:737)
04-02 14:39:44.371: com.evotegra.aCoDriver.ACoDriverActivity.onPause(ACoDriverActivity.java:94)
04-02 14:39:44.371: android.app.Activity.performPause(Activity.java:3851)
04-02 14:39:44.381: android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1191)
04-02 14:39:44.381: android.app.ActivityThread.performPauseActivity(ActivityThread.java:2356)
04-02 14:39:44.381: android.app.ActivityThread.performPauseActivity(ActivityThread.java:2326)
04-02 14:39:44.381: android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:2818)
04-02 14:39:44.401: android.app.ActivityThread.access$1600(ActivityThread.java:117)
04-02 14:39:44.401: android.app.ActivityThread$H.handleMessage(ActivityThread.java:946)
04-02 14:39:44.411: android.os.Handler.dispatchMessage(Handler.java:99)
04-02 14:39:44.411: android.os.Looper.loop(Looper.java:130)
04-02 14:39:44.411: android.app.ActivityThread.main(ActivityThread.java:3740)
04-02 14:39:44.462: java.lang.reflect.Method.invokeNative(Native Method)
04-02 14:39:44.462: java.lang.reflect.Method.invoke(Method.java:507)
04-02 14:39:44.462: com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:880)
04-02 14:39:44.482: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:638)
04-02 14:39:44.492: dalvik.system.NativeStart.main(Native Method)
04-02 14:39:44.772: W/ServerManager(8731): <!>com.evotegra.aCoDriver.data.ServerManager$ConnectionManager 559<!> Connection thread was interrupted. Message: null
04-02 14:39:44.862: dalvik.system.VMStack.getThreadStackTrace(Native Method)
04-02 14:39:44.862: java.lang.Thread.getStackTrace(Thread.java:737)
04-02 14:39:44.862: com.evotegra.aCoDriver.ACoDriverActivity.onPause(ACoDriverActivity.java:94)
04-02 14:39:44.862: android.app.Activity.performPause(Activity.java:3851)
04-02 14:39:44.862: android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1191)
04-02 14:39:44.862: android.app.ActivityThread.performPauseActivity(ActivityThread.java:2356)
04-02 14:39:44.862: android.app.ActivityThread.performPauseActivity(ActivityThread.java:2326)
04-02 14:39:44.862: android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:2818)
04-02 14:39:44.872: android.app.ActivityThread.access$1600(ActivityThread.java:117)
04-02 14:39:44.872: android.app.ActivityThread$H.handleMessage(ActivityThread.java:946)
04-02 14:39:44.872: android.os.Handler.dispatchMessage(Handler.java:99)
04-02 14:39:44.872: android.os.Looper.loop(Looper.java:130)
04-02 14:39:44.872: android.app.ActivityThread.main(ActivityThread.java:3740)
04-02 14:39:44.872: java.lang.reflect.Method.invokeNative(Native Method)
04-02 14:39:44.872: java.lang.reflect.Method.invoke(Method.java:507)
04-02 14:39:44.872: com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:880)
04-02 14:39:44.872: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:638)
04-02 14:39:44.872: dalvik.system.NativeStart.main(Native Method)
04-02 14:39:48.315: dalvik.system.VMStack.getThreadStackTrace(Native Method)
04-02 14:39:48.315: java.lang.Thread.getStackTrace(Thread.java:737)
04-02 14:39:48.315: com.evotegra.aCoDriver.ACoDriverActivity.onPause(ACoDriverActivity.java:94)
04-02 14:39:48.315: android.app.Activity.performPause(Activity.java:3851)
04-02 14:39:48.315: android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1191)
04-02 14:39:48.325: android.app.ActivityThread.performPauseActivity(ActivityThread.java:2356)
04-02 14:39:48.335: android.app.ActivityThread.performPauseActivity(ActivityThread.java:2326)
04-02 14:39:48.345: android.app.ActivityThread.handlePauseActivity(ActivityThread.java:2306)
04-02 14:39:48.345: android.app.ActivityThread.access$1700(ActivityThread.java:117)
04-02 14:39:48.345: android.app.ActivityThread$H.handleMessage(ActivityThread.java:953)
04-02 14:39:48.355: android.os.Handler.dispatchMessage(Handler.java:99)
04-02 14:39:48.355: android.os.Looper.loop(Looper.java:130)
04-02 14:39:48.355: android.app.ActivityThread.main(ActivityThread.java:3740)
04-02 14:39:48.355: java.lang.reflect.Method.invokeNative(Native Method)
04-02 14:39:48.375: java.lang.reflect.Method.invoke(Method.java:507)
04-02 14:39:48.375: com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:880)
04-02 14:39:48.375: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:638)
04-02 14:39:48.385: dalvik.system.NativeStart.main(Native Method)

Failure delivering result ResultInfo in Action Bar Sherlock, Facebook

I'm using the Action bar sherlock library in my application and I currently have one two tabs as fragments:
Tab A : Users views information in a list
Tab B : Users can log into facebook
I need the onActivityResult() to handle Facebook sessions in Tab B so I have this code in my Main Activity :
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Session.getActiveSession().onActivityResult(this, requestCode, resultCode, data);
}
However, this creates this error log when i press the Back Button in Tab A:
04-02 19:46:07.488: E/AndroidRuntime(1380): FATAL EXCEPTION: main
04-02 19:46:07.488: E/AndroidRuntime(1380): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=65537, result=0, data=null} to activity {com.example.chartviewer/com.example.chartviewer.MainActivity}: java.lang.NullPointerException
04-02 19:46:07.488: E/AndroidRuntime(1380): at android.app.ActivityThread.deliverResults(ActivityThread.java:3141)
04-02 19:46:07.488: E/AndroidRuntime(1380): at android.app.ActivityThread.handleSendResult(ActivityThread.java:3184)
04-02 19:46:07.488: E/AndroidRuntime(1380): at android.app.ActivityThread.access$1100(ActivityThread.java:130)
04-02 19:46:07.488: E/AndroidRuntime(1380): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1243)
04-02 19:46:07.488: E/AndroidRuntime(1380): at android.os.Handler.dispatchMessage(Handler.java:99)
04-02 19:46:07.488: E/AndroidRuntime(1380): at android.os.Looper.loop(Looper.java:137)
04-02 19:46:07.488: E/AndroidRuntime(1380): at android.app.ActivityThread.main(ActivityThread.java:4745)
04-02 19:46:07.488: E/AndroidRuntime(1380): at java.lang.reflect.Method.invokeNative(Native Method)
04-02 19:46:07.488: E/AndroidRuntime(1380): at java.lang.reflect.Method.invoke(Method.java:511)
04-02 19:46:07.488: E/AndroidRuntime(1380): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
04-02 19:46:07.488: E/AndroidRuntime(1380): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
04-02 19:46:07.488: E/AndroidRuntime(1380): at dalvik.system.NativeStart.main(Native Method)
04-02 19:46:07.488: E/AndroidRuntime(1380): Caused by: java.lang.NullPointerException
04-02 19:46:07.488: E/AndroidRuntime(1380): at com.example.chartviewer.MainActivity.onActivityResult(MainActivity.java:91)
04-02 19:46:07.488: E/AndroidRuntime(1380): at android.app.Activity.dispatchActivityResult(Activity.java:5192)
04-02 19:46:07.488: E/AndroidRuntime(1380): at android.app.ActivityThread.deliverResults(ActivityThread.java:3137)
04-02 19:46:07.488: E/AndroidRuntime(1380): ... 11 more
Any idea how to handle this?

Categories

Resources