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

  • SEARCH
  • Home
  • 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 6384867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:49:43+00:00 2026-05-25T02:49:43+00:00

I’ve got a question heres my Code: package de.retowaelchli.filterit; import android.app.Activity; import android.os.Bundle; import

  • 0

I’ve got a question heres my Code:

    package de.retowaelchli.filterit;

import android.app.Activity;
import android.os.Bundle;
import android.widget.EditText;
import android.widget.RadioGroup;

import de.retowaelchli.filterit.database.ADFilterDBAdapter;


public class ADFilterConfigActivity extends Activity {

    //Variablen deklaration
    private ADFilterDBAdapter mDbHelper;
    private String name;
    private String keyword;
    private String cache;
    private String save;


    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.autodelete_config);
        radiobuttoncheck();

        //Hier wir die Datenbank aufgerufen
        mDbHelper = new ADFilterDBAdapter(this);
        mDbHelper.open();


        //Hier werden die EditTextfelder gesucht
        EditText edtTextName=(EditText )findViewById(R.id.ADConfigName);
        EditText edtTextKeyword=(EditText )findViewById(R.id.ADConfigKeyword);

        //Hier wird der Inhalt der EditText boxen in einen String gespeichert
        name = edtTextName.getText().toString();
        keyword = edtTextKeyword.getText().toString();
        }

        private void radiobuttoncheck() {

        //Hier wird ausgewertet welcher Button geklickt wurde
        RadioGroup rg = (RadioGroup) findViewById(R.id.adcachegroup);
        rg.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            public void onCheckedChanged(RadioGroup group, final int checkedId) {
                switch (checkedId) {
                case R.id.adcache_true:
                    save = new StringBuilder(save).append("true").toString();
                    cache = save.toString();

                    break;
                case R.id.adcache_false:
                    save = new StringBuilder(save).append("false").toString();
                    cache = save.toString();

                    break;
                        }
                }
            });
        }
 }

The Code doesnt show one Error in Eclipse but if i try to test the code on my Phone i get a ForceClose.

What I found is if i dont use the radiobuttoncheck it works. But i dunno whats the error in it.

Thx in Advance

safari

sorry forgot heres the logcat-log:

    08-31 10:35:22.823: INFO/ActivityManager(1740): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=de.retowaelchli.filterit/.StartseiteActivity } from pid 1867
08-31 10:35:22.843: VERBOSE/HtcAppUsageStats(1740): (launch app, package): (Filter It, de.retowaelchli.filterit)
08-31 10:35:22.863: INFO/ActivityManager(1740): Start proc de.retowaelchli.filterit for activity de.retowaelchli.filterit/.StartseiteActivity: pid=27542 uid=10150 gids={}
08-31 10:35:22.933: DEBUG/dalvikvm(1541): GC_EXPLICIT freed 11K, 51% free 2684K/5379K, external 0K/0K, paused 78ms
08-31 10:35:23.033: INFO/SuperPowerSvc(2428): [SuperPowerSvc] App launched: [de.retowaelchli.filterit]
08-31 10:35:23.063: DEBUG/dalvikvm(1541): GC_EXPLICIT freed <1K, 51% free 2684K/5379K, external 0K/0K, paused 88ms
08-31 10:35:23.143: DEBUG/dalvikvm(1541): GC_EXPLICIT freed <1K, 51% free 2684K/5379K, external 0K/0K, paused 67ms
08-31 10:35:23.223: DEBUG/dalvikvm(1740): GC_EXTERNAL_ALLOC freed 659K, 35% free 9759K/14855K, external 9725K/11773K, paused 151ms
08-31 10:35:23.473: WARN/ResourceType(1740): Skipping entry 0x7f040007 in package table 0 because it is not complex!
08-31 10:35:23.483: WARN/ResourceType(1740): Skipping entry 0x7f040008 in package table 0 because it is not complex!
08-31 10:35:23.603: DEBUG/dalvikvm(27542): GC_EXTERNAL_ALLOC freed 50K, 50% free 2694K/5379K, external 0K/0K, paused 45ms
08-31 10:35:23.733: WARN/InputManagerService(1740): [unbindCurrentClientLocked] Disable input method client.
08-31 10:35:23.733: WARN/InputManagerService(1740): [startInputLocked] Enable input method client.
08-31 10:35:23.803: INFO/ActivityManager(1740): Displayed de.retowaelchli.filterit/.StartseiteActivity: +947ms (total +1m12s949ms)
08-31 10:35:24.963: INFO/ActivityManager(1740): Starting activity: Intent { cmp=de.retowaelchli.filterit/.ADeleteActivity } from pid 27542
08-31 10:35:24.973: INFO/SuperPowerSvc(2428): [SuperPowerSvc] App launched: [de.retowaelchli.filterit]
08-31 10:35:25.113: DEBUG/dalvikvm(27542): GC_EXTERNAL_ALLOC freed 36K, 49% free 2767K/5379K, external 5760K/7192K, paused 21ms
08-31 10:35:25.313: INFO/ActivityManager(1740): Displayed de.retowaelchli.filterit/.ADeleteActivity: +350ms
08-31 10:35:26.743: INFO/ActivityManager(1740): Starting activity: Intent { cmp=de.retowaelchli.filterit/.ADFilterConfigActivity } from pid 27542
08-31 10:35:26.783: INFO/[POST_RESELECT](27542): [spanChange] (o, oldStart, newStart, oldEnd, newEnd)=(android.text.Selection$START@401090b8,-1,0,-1,0)
08-31 10:35:26.783: INFO/[POST_RESELECT](27542): [spanChange] (o, oldStart, newStart, oldEnd, newEnd)=(android.text.Selection$END@40130050,-1,0,-1,0)
08-31 10:35:26.783: INFO/[POST_RESELECT](27542): [spanChange] (o, oldStart, newStart, oldEnd, newEnd)=(android.text.Selection$START@401090b8,-1,0,-1,0)
08-31 10:35:26.783: INFO/[POST_RESELECT](27542): [spanChange] (o, oldStart, newStart, oldEnd, newEnd)=(android.text.Selection$END@40130050,-1,0,-1,0)
08-31 10:35:26.803: DEBUG/AndroidRuntime(27542): Shutting down VM
08-31 10:35:26.803: WARN/dalvikvm(27542): threadid=1: thread exiting with uncaught exception (group=0x4001d5a0)
08-31 10:35:26.803: ERROR/AndroidRuntime(27542): FATAL EXCEPTION: main
08-31 10:35:26.803: ERROR/AndroidRuntime(27542): java.lang.RuntimeException: Unable to start activity ComponentInfo{de.retowaelchli.filterit/de.retowaelchli.filterit.ADFilterConfigActivity}: java.lang.NullPointerException
08-31 10:35:26.803: ERROR/AndroidRuntime(27542):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1816)
08-31 10:35:26.803: ERROR/AndroidRuntime(27542):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1837)
08-31 10:35:26.803: ERROR/AndroidRuntime(27542):     at android.app.ActivityThread.access$1500(ActivityThread.java:132)
08-31 10:35:26.803: ERROR/AndroidRuntime(27542):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1033)
08-31 10:35:26.803: ERROR/AndroidRuntime(27542):     at android.os.Handler.dispatchMessage(Handler.java:99)
08-31 10:35:26.803: ERROR/AndroidRuntime(27542):     at android.os.Looper.loop(Looper.java:143)
08-31 10:35:26.803: ERROR/AndroidRuntime(27542):     at android.app.ActivityThread.main(ActivityThread.java:4196)
08-31 10:35:26.803: ERROR/AndroidRuntime(27542):     at java.lang.reflect.Method.invokeNative(Native Method)
08-31 10:35:26.803: ERROR/AndroidRuntime(27542):     at java.lang.reflect.Method.invoke(Method.java:507)
08-31 10:35:26.803: ERROR/AndroidRuntime(27542):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
08-31 10:35:26.803: ERROR/AndroidRuntime(27542):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
08-31 10:35:26.803: ERROR/AndroidRuntime(27542):     at dalvik.system.NativeStart.main(Native Method)
08-31 10:35:26.803: ERROR/AndroidRuntime(27542): Caused by: java.lang.NullPointerException
08-31 10:35:26.803: ERROR/AndroidRuntime(27542):     at de.retowaelchli.filterit.ADFilterConfigActivity.radiobuttoncheck(ADFilterConfigActivity.java:46)
08-31 10:35:26.803: ERROR/AndroidRuntime(27542):     at de.retowaelchli.filterit.ADFilterConfigActivity.onCreate(ADFilterConfigActivity.java:26)
08-31 10:35:26.803: ERROR/AndroidRuntime(27542):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
08-31 10:35:26.803: ERROR/AndroidRuntime(27542):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1780)
08-31 10:35:26.803: ERROR/AndroidRuntime(27542):     ... 11 more
08-31 10:35:26.813: WARN/ActivityManager(1740):   Force finishing activity de.retowaelchli.filterit/.ADFilterConfigActivity
08-31 10:35:26.813: WARN/ActivityManager(1740):   Force finishing activity de.retowaelchli.filterit/.ADeleteActivity
08-31 10:35:26.873: INFO/SuperPowerSvc(2428): [SuperPowerSvc] App launched: [de.retowaelchli.filterit]
08-31 10:35:27.323: WARN/ActivityManager(1740): Activity pause timeout for HistoryRecord{4094f4d8 de.retowaelchli.filterit/.ADFilterConfigActivity}

And Finally heres the layout:

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

        <TextView 
        style="@style/NormalFont"
        android:text="@string/adconfig"     
        android:layout_weight="0.05" 
        android:clickable="false"
        />

        <TextView
            style="@style/SmallFont"
            android:text="@string/adname"
            android:layout_weight="0.03" />
        <EditText 
            android:layout_width="match_parent" 
            android:id="@+id/ADConfigName" 
            android:layout_weight="0.05" 
            android:layout_height="25dp"
            android:layout_marginBottom="20dp">
            <requestFocus></requestFocus>
        </EditText>

        <TextView
            style="@style/SmallFont"
            android:text="@string/adkeyword"
            android:layout_weight="0.03"
            />
        <EditText 
            android:layout_width="match_parent" 
            android:id="@+id/ADConfigKeyword" 
            android:layout_weight="0.05" 
            android:layout_height="25dp"
            android:layout_marginBottom="20dp">
            <requestFocus></requestFocus>
        </EditText>

            <TextView
            style="@style/SmallFont"
            android:text="@string/adcache"
            android:layout_weight="0.03"
             />
        <RadioGroup 
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" 
            android:orientation="horizontal"
            android:checkedButton="@+id/adcachegroup" 
            android:id="@+id/adcache"
            android:gravity="center" >

            <RadioButton 
                android:text="Yes" 
                android:id="@+id/adcache_true" 
                android:layout_width="80dip" 
                android:layout_height="wrap_content"
>
            </RadioButton>

            <RadioButton 
                android:text="No" 
                android:id="@+id/adcache_false" 
                android:layout_width="80dip" 
                android:layout_height="wrap_content">
            </RadioButton>
        </RadioGroup> 

        <TableLayout 
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:id="@+id/ADConfigMainsite"
            android:layout_weight="0.76"
            android:gravity="bottom">   
                <TableRow 
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"        
                    android:id="@+id/ADConfigMainsite"
                    android:onClick="onClickADConfigSave"
                    android:layout_weight="0.05"
                    android:gravity="bottom">
                        <TextView   
                            android:text="@string/adconfigsave" 
                            style="@style/NormalFont"   
                            android:gravity="bottom"/>
                 </TableRow>
    </TableLayout>


</LinearLayout>
  • 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-05-25T02:49:43+00:00Added an answer on May 25, 2026 at 2:49 am

    You can’t create a StringBuilder with a null string:

    save = new StringBuilder(save).append("true").toString();
    

    Initialize save string:

    private String save = "";
    

    EDIT: According to the locgat output widget with id adcachegroup cannot be found in the layout. Ensure you’re setting a correct layout.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
i got an object with contents of html markup in it, for example: string
I am writing an app with both english and french support. The app requests
I am using Paperclip to handle profile photo uploads in my app. They upload
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti

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.