Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8135531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:27:06+00:00 2026-06-06T10:27:06+00:00

Spec for DisplayActivity.java is always crashing when i add something. Can’t figure out what

  • 0

Spec for DisplayActivity.java is always crashing when i add something. Can’t figure out what im doing wrong. Here is my current code.

ControlActivity.java

package com.control.driswave;


import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;
import android.widget.Toast;

import com.control.driswave.R;
import com.stericson.RootTools.RootTools;

public class ControlActivity extends TabActivity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    if (RootTools.isAccessGiven()) {
        Toast root = Toast.makeText(getApplicationContext(), 
                "Root Granted", Toast.LENGTH_SHORT);
        root.show();
    } else {
        Toast noRoot = Toast.makeText(getApplicationContext(), 
                "Root Access Needed To Continue", Toast.LENGTH_LONG);
        noRoot.show();
        finish();
    }

    Resources res = getResources(); // used to get res drawings (i.e. display files)
    TabHost tabHost = getTabHost(); // used to create TabHost located in main.xml
    TabHost.TabSpec spec; //TabHost specifications which are the same in each view
    Intent intent; //intent for each tab. *RESEARCH INTENT*


    // New Class Added Caused FC. Was working. Spec no longer working again.

     //____Display
    intent = new Intent().setClass(this, DisplayActivity.class);

    spec = tabHost.newTabSpec("display").setIndicator("Display",
            res.getDrawable(R.drawable.ic_tab_display))
            .setContent(intent); // create picture to be used for tab
    tabHost.addTab(spec);

    //____Power
    intent = new Intent().setClass(this, PowerActivity.class);

    spec = tabHost.newTabSpec("power").setIndicator("Power", 
            res.getDrawable(R.drawable.ic_tab_display))
            .setContent(intent);
    tabHost.addTab(spec);





}
}

DisplayActivity.java

package com.control.driswave;

import java.io.File;

import com.stericson.RootTools.RootTools;

import android.app.Activity;
import android.os.Bundle;
import android.provider.Settings;
import android.view.View.OnClickListener;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;
import android.widget.TextView;
import android.widget.Toast;

public class DisplayActivity extends Activity {
private int prevValue = Integer.parseInt(Settings.System.WINDOW_ANIMATION_SCALE);
private SeekBar brBar;
private TextView brightLevel;

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.display);


    //_____Disable Boot Animation_____// NEEDS TESTING http://mgmblog.com/2008/02/18/android-checkbox-oncheckedchangelistener/
    CheckBox dba = (CheckBox) findViewById(R.id.DBA);
    dba.setOnCheckedChangeListener(new OnCheckedChangeListener() {

        public void onCheckedChanged(CompoundButton dba, boolean isChecked) {
            if (dba.isChecked()) {
            RootTools.remount("/system/", "rw");
            File ba = new File("/System/Media/bootanimation.zip");
            ba.renameTo(new File("/System/Media/bootanimation.zip.bak"));
            Toast.makeText(getApplicationContext(), "Boot Animation Disabled", Toast.LENGTH_SHORT);
            } else {
                Toast.makeText(getApplicationContext(), "Boot Animation Enabled", Toast.LENGTH_SHORT);
            }

        }

    });




    //_____Disable Window Animations_____//
    CheckBox dwa = (CheckBox) findViewById(R.id.DWA);
    dwa.setOnCheckedChangeListener(new OnCheckedChangeListener() {
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {

            if (buttonView.isChecked()) {
                Settings.System.putInt(getContentResolver(), Settings.System.WINDOW_ANIMATION_SCALE, 0);
            } else {
                Settings.System.putInt(getContentResolver(), Settings.System.WINDOW_ANIMATION_SCALE, prevValue);
            }
        }
    });


    //_____Brightness Seek Bar____//
    brBar = (SeekBar) findViewById(R.id.brSeekbar);
    brightLevel = (TextView) findViewById(R.id.brSeekbar_num);
    brBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {

        public void onProgressChanged(SeekBar brBar, int brLevel, boolean arg2) {
            Settings.System.putInt(getContentResolver(), Settings.System.SCREEN_BRIGHTNESS, brLevel);
            brightLevel.setText(brLevel);

        }

        public void onStartTrackingTouch(SeekBar brBar) {
            brightLevel.setText("Changing...");

        }

        public void onStopTrackingTouch(SeekBar brBar) {
            // Nothing

        }


    });




}

}

Display.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<TextView
    android:id="@+id/textView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/bcTitle"
    android:textAppearance="?android:attr/textAppearanceSmall" />

<CheckBox
    android:id="@+id/DBA"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/dabCB" />

<CheckBox
    android:id="@+id/DWA"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/DWA" />

<TextView
    android:id="@+id/BrC"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/bright"
    android:textAppearance="?android:attr/textAppearanceSmall" />

<SeekBar
    android:id="@+id/brSeekbar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" />

<TextView
    android:id="@+id/brSeekbar_num"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center_horizontal"
    android:text="@string/brightlevel"
    android:textAppearance="?android:attr/textAppearanceMedium" />

ControlManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.control.driswave"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk android:minSdkVersion="10" />
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
<uses-permission android:name="android.permission.CHANGE_CONFIGURATION"/>
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.DEVICE_POWER"/>
<uses-permission android:name="android.permission.FLASHLIGHT"/>
<uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS"/>
<uses-permission android:name="android.permission.SET_ORIENTATION"/>
<uses-permission android:name="android.permission.SET_ANIMATION_SCALE"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="com.android.browser.permission.WRITE_HISTORY_BOOKMARKS"/>
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"/>
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS"/>
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS"/>

<application
    android:debuggable="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <activity
        android:name=".ControlActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".DisplayActivity"
        android:label="@string/displaytab" >
    </activity>
    <activity
        android:name=".PowerActivity"
        android:label="@string/powertab" >
    </activity>


</application>

LOG.TXT

06-25 17:38:44.035: D/dalvikvm(25731): GC_EXPLICIT freed 58K, 43% free 3067K/5379K, external 2540K/2666K, paused 41ms
06-25 17:38:48.293: D/AndroidRuntime(25731): Shutting down VM
06-25 17:38:48.293: W/dalvikvm(25731): threadid=1: thread exiting with uncaught exception (group=0x4001e560)
06-25 17:38:48.332: E/AndroidRuntime(25731): FATAL EXCEPTION: main
06-25 17:38:48.332: E/AndroidRuntime(25731): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.control.driswave/com.control.driswave.ControlActivity}: java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.control.driswave/com.control.driswave.DisplayActivity}: java.lang.NumberFormatException: unable to parse 'window_animation_scale' as integer
06-25 17:38:48.332: E/AndroidRuntime(25731):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1702)
06-25 17:38:48.332: E/AndroidRuntime(25731):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1722)
06-25 17:38:48.332: E/AndroidRuntime(25731):    at android.app.ActivityThread.access$1500(ActivityThread.java:124)
06-25 17:38:48.332: E/AndroidRuntime(25731):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:974)
06-25 17:38:48.332: E/AndroidRuntime(25731):    at android.os.Handler.dispatchMessage(Handler.java:99)
06-25 17:38:48.332: E/AndroidRuntime(25731):    at android.os.Looper.loop(Looper.java:130)
06-25 17:38:48.332: E/AndroidRuntime(25731):    at android.app.ActivityThread.main(ActivityThread.java:3821)
06-25 17:38:48.332: E/AndroidRuntime(25731):    at java.lang.reflect.Method.invokeNative(Native Method)
06-25 17:38:48.332: E/AndroidRuntime(25731):    at java.lang.reflect.Method.invoke(Method.java:507)
06-25 17:38:48.332: E/AndroidRuntime(25731):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
06-25 17:38:48.332: E/AndroidRuntime(25731):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
06-25 17:38:48.332: E/AndroidRuntime(25731):    at dalvik.system.NativeStart.main(Native Method)
06-25 17:38:48.332: E/AndroidRuntime(25731): Caused by: java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.control.driswave/com.control.driswave.DisplayActivity}: java.lang.NumberFormatException: unable to parse 'window_animation_scale' as integer
06-25 17:38:48.332: E/AndroidRuntime(25731):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1624)
06-25 17:38:48.332: E/AndroidRuntime(25731):    at android.app.ActivityThread.startActivityNow(ActivityThread.java:1530)
06-25 17:38:48.332: E/AndroidRuntime(25731):    at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:127)
06-25 17:38:48.332: E/AndroidRuntime(25731):    at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:339)
06-25 17:38:48.332: E/AndroidRuntime(25731):    at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:696)
06-25 17:38:48.332: E/AndroidRuntime(25731):    at android.widget.TabHost.setCurrentTab(TabHost.java:328)
06-25 17:38:48.332: E/AndroidRuntime(25731):    at android.widget.TabHost.addTab(TabHost.java:218)
06-25 17:38:48.332: E/AndroidRuntime(25731):    at com.control.driswave.ControlActivity.onCreate(ControlActivity.java:46)
06-25 17:38:48.332: E/AndroidRuntime(25731):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
06-25 17:38:48.332: E/AndroidRuntime(25731):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1666)
06-25 17:38:48.332: E/AndroidRuntime(25731):    ... 11 more
06-25 17:38:48.332: E/AndroidRuntime(25731): Caused by: java.lang.NumberFormatException: unable to parse 'window_animation_scale' as integer
06-25 17:38:48.332: E/AndroidRuntime(25731):    at java.lang.Integer.parse(Integer.java:383)
06-25 17:38:48.332: E/AndroidRuntime(25731):    at java.lang.Integer.parseInt(Integer.java:372)
06-25 17:38:48.332: E/AndroidRuntime(25731):    at java.lang.Integer.parseInt(Integer.java:332)
06-25 17:38:48.332: E/AndroidRuntime(25731):    at com.control.driswave.DisplayActivity.<init>(DisplayActivity.java:20)
06-25 17:38:48.332: E/AndroidRuntime(25731):    at java.lang.Class.newInstanceImpl(Native Method)
06-25 17:38:48.332: E/AndroidRuntime(25731):    at java.lang.Class.newInstance(Class.java:1409)
06-25 17:38:48.332: E/AndroidRuntime(25731):    at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
06-25 17:38:48.332: E/AndroidRuntime(25731):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1616)
06-25 17:38:48.332: E/AndroidRuntime(25731):    ... 20 more
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T10:27:07+00:00Added an answer on June 6, 2026 at 10:27 am

    Well, your problem is this:

    Java.lang.NumberFormatException: unable to parse 'window_animation_scale' as integer

    Fix that and the rest should fall in line.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As per Java API spec, the signature of Collections.reverseOrder is public static <T> Comparator<T>
I'm starting to spec out an image gallery type system similar to Facebook's. Members
The spec says that a horizontal scrollbar is supposed to be always shown if
According to the spec (Annex C), strict-mode code can't do pretty much anything that
I'm currently spec'ing out a solution running on EC2. Setting up web servers, utilizing
Is it by spec that, given a MyClass.java file containing package com.mycorp.foo; public class
The EJB3 spec indicates that EJB2 and EJB3 can co-exist in a single application.
The SVG spec talks about Properties.. what are these? Can they be declared as
Received a spec to add over 800 properties to an object. Is their any
I have a spec in my current project that requires us to advise the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.