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 7927893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T19:33:14+00:00 2026-06-03T19:33:14+00:00

I have a problem with my app. When starting a the FusRoDAHnomusic activity, it

  • 0

I have a problem with my app. When starting a the “FusRoDAHnomusic” activity, it crashes. I just get a force close?

FusRoDAHActivity:

package com.frede.fusrodah;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.RelativeLayout;
import com.google.ads.AdRequest;
import com.google.ads.AdSize;
import com.google.ads.AdView;

public class FusRoDAHActivity extends Activity {
    private AdView adView2;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.main);
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        Button next = (Button) findViewById(R.id.button1);
        next.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                Intent myIntent = new Intent(view.getContext(), FusRoDAH.class);
                startActivityForResult(myIntent, 0);
            }
        });

        Button next2 = (Button) findViewById(R.id.button4);
        next2.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                Intent myIntent = new Intent(view.getContext(), FusRoDAHnomusic.class);
                startActivityForResult(myIntent, 0);
            }
        });

        // Create an ad.
        adView2 = new AdView(this, AdSize.BANNER, "XXXXXXXXXXXX");

        // Add the AdView to the view hierarchy. The view will have no size
        // until the ad is loaded.
        RelativeLayout layout = (RelativeLayout) findViewById(R.id.main1);
        layout.addView(adView2);

        // Create an ad request. Check logcat output for the hashed device ID to
        // get test ads on a physical device.
        AdRequest adRequest = new AdRequest();

        // Start loading the ad in the background.
        adView2.loadAd(adRequest);
    }

    /** Called before the activity is destroyed. */
    @Override
    public void onDestroy() {
        // Destroy the AdView.
        if (adView2 != null) {
            adView2.destroy();
        }
        super.onDestroy();
    }
}

FusRoDAHnomusic:

package com.frede.fusrodah;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.RelativeLayout;
import com.google.ads.AdRequest;
import com.google.ads.AdSize;
import com.google.ads.AdView;

public class FusRoDAHnomusic extends Activity {
    private AdView adView3;
    @Override
    public void onBackPressed() {
        return;
    }

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.fusrodahnomusic);
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);

        final MediaPlayer mediaPlayer = MediaPlayer.create(getBaseContext(), R.raw.fusrodahnomusic);
        mediaPlayer.start(); // no need to call prepare(); create() does that for you

        Button next = (Button) findViewById(R.id.button3);
        next.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                mediaPlayer.stop();
                Intent intent = new Intent();
                setResult(RESULT_OK, intent);
                finish();
            }
        });

        // Create an ad.
        adView3 = new AdView(this, AdSize.BANNER, "XXXXXXXXXX");

        // Add the AdView to the view hierarchy. The view will have no size
        // until the ad is loaded.
        RelativeLayout layout = (RelativeLayout) findViewById(R.id.main1);
        layout.addView(adView3);

        // Create an ad request. Check logcat output for the hashed device ID to
        // get test ads on a physical device.
        AdRequest adRequest = new AdRequest();

        // Start loading the ad in the background.
        adView3.loadAd(adRequest);
    }

    /** Called before the activity is destroyed. */
    @Override
    public void onDestroy() {
        // Destroy the AdView.
            if (adView3 != null) {
                adView3.destroy();
            }

            super.onDestroy();
        }
    }
}

FusRoDAH:

package com.frede.fusrodah;

import android.app.Activity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.RelativeLayout;
import com.google.ads.AdRequest;
import com.google.ads.AdSize;
import com.google.ads.AdView;

public class FusRoDAH extends Activity {
    private AdView adView;

    @Override
    public void onBackPressed() {
        return;
    }

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.fusrodah);
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        final MediaPlayer mediaPlayer = MediaPlayer.create(getBaseContext(), R.raw.fusrodah);
        mediaPlayer.start(); // no need to call prepare(); create() does that for you
        Button next = (Button) findViewById(R.id.button2);
        next.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                mediaPlayer.stop();
                Intent intent = new Intent();
                setResult(RESULT_OK, intent);
                finish();
            }
        });

        // Create an ad.
        adView = new AdView(this, AdSize.BANNER, "XXXXXXXXXXXX");

        // Add the AdView to the view hierarchy. The view will have no size
        // until the ad is loaded.
        RelativeLayout layout = (RelativeLayout) findViewById(R.id.fusrodah);
        layout.addView(adView);

        // Create an ad request. Check logcat output for the hashed device ID to
        // get test ads on a physical device.
        AdRequest adRequest = new AdRequest();

        // Start loading the ad in the background.
        adView.loadAd(adRequest);
    }

    /** Called before the activity is destroyed. */
    @Override
    public void onDestroy() {
        // Destroy the AdView.
        if (adView != null) {
            adView.destroy();
        }
        super.onDestroy();
    };
}

LogCat:

03-31 22:06:05.485: D/webviewglue(797): nativeDestroy view: 0x3ab4f0
03-31 22:06:05.494: D/webviewglue(797): nativeDestroy view: 0x3ab3b8
03-31 22:06:05.505: D/dalvikvm(797): GC freed 393 objects / 17312 bytes in 267ms
03-31 22:06:05.514: E/webcoreglue(797): The real object has been deleted
03-31 22:06:05.544: E/webcoreglue(797): The real object has been deleted
03-31 22:06:07.394: W/MediaPlayer(797): info/warning (1, 44)
03-31 22:06:08.234: D/AndroidRuntime(797): Shutting down VM
03-31 22:06:08.254: W/dalvikvm(797): threadid=3: thread exiting with uncaught exception     (group=0x4001b188)
03-31 22:06:08.274: E/AndroidRuntime(797): Uncaught handler: thread main exiting due to uncaught exception
03-31 22:06:08.345: E/AndroidRuntime(797): java.lang.RuntimeException: Unable to start         activity ComponentInfo{com.frede.fusrodah/com.frede.fusrodah.FusRoDAHnomusic}:     java.lang.NullPointerException
03-31 22:06:08.345: E/AndroidRuntime(797):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
03-31 22:06:08.345: E/AndroidRuntime(797):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
03-31 22:06:08.345: E/AndroidRuntime(797):  at android.app.ActivityThread.access$2200(ActivityThread.java:119)
03-31 22:06:08.345: E/AndroidRuntime(797):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
03-31 22:06:08.345: E/AndroidRuntime(797):  at android.os.Handler.dispatchMessage(Handler.java:99)
03-31 22:06:08.345: E/AndroidRuntime(797):  at android.os.Looper.loop(Looper.java:123)
03-31 22:06:08.345: E/AndroidRuntime(797):  at android.app.ActivityThread.main(ActivityThread.java:4363)
03-31 22:06:08.345: E/AndroidRuntime(797):  at java.lang.reflect.Method.invokeNative(Native Method)
03-31 22:06:08.345: E/AndroidRuntime(797):  at java.lang.reflect.Method.invoke(Method.java:521)
03-31 22:06:08.345: E/AndroidRuntime(797):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
03-31 22:06:08.345: E/AndroidRuntime(797):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
03-31 22:06:08.345: E/AndroidRuntime(797):  at dalvik.system.NativeStart.main(Native Method)
03-31 22:06:08.345: E/AndroidRuntime(797): Caused by: java.lang.NullPointerException
03-31 22:06:08.345: E/AndroidRuntime(797):  at                 com.frede.fusrodah.FusRoDAHnomusic.onCreate(FusRoDAHnomusic.java:66)
03-31 22:06:08.345: E/AndroidRuntime(797):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
03-31 22:06:08.345: E/AndroidRuntime(797):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
03-31 22:06:08.345: E/AndroidRuntime(797):  ... 11 more
03-31 22:06:08.475: I/dalvikvm(797): threadid=7: reacting to signal 3
03-31 22:06:08.704: I/dalvikvm(797): Wrote stack trace to '/data/anr/traces.txt'
03-31 22:06:54.401: I/Process(797): Sending signal. PID: 797 SIG: 9
  • 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-03T19:33:18+00:00Added an answer on June 3, 2026 at 7:33 pm

    Just read your stack trace. It says NullPointerException at line 66. 65-66 is this:

    RelativeLayout layout = (RelativeLayout) findViewById(R.id.main1);
    layout.addView(adView3);
    

    So that means layout is null which means that probably main1 is not in that layout.

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

Sidebar

Related Questions

I just starting as an Android app developer and I already have a problem
A have lift app starting ssh daemon in Boot.scala. Here is the problem: when
I have a strange problem. My app keeps starting in landscape mode. If I
Seem to have a problem starting my Java app: Exception in thread main java.lang.NoClassDefFoundError:
I have the problem that starting my app on iPad shows me 2 splash-screens.
I have never had a problem starting a new app, but today I got
I've ran into a problem. Everytime I'am starting my app it crashes. Heres me
I'm currently solving a problem of starting external tool from .net app. I have
I have a curious problem: My app is distributed through ClickOnce. I recently installed
I have problem in declaring the intents on my app. I have a form

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.