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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:16:42+00:00 2026-06-18T05:16:42+00:00

I think that Button bTutorial1 = (Button) findViewById(R.layout.tutorial1); bTutorial1.setOnClickListener(new View.OnClickListener() { is equal to

  • 0

I think that

Button bTutorial1 = (Button) findViewById(R.layout.tutorial1);
    bTutorial1.setOnClickListener(new View.OnClickListener() {

is equal to “Null”.

( I read it somewhere but did not see a fix to it)

If that isn’t the problem plz I don’t know..

Thx for any help I can get.

Sincerely, Robin

activity_main Code:

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity" >

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:src="@drawable/ic_launcher" />

    <Button
        android:id="@+id/gotoKanal2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_above="@+id/gotoKanal3"
        android:layout_alignParentLeft="true"
        android:layout_marginBottom="14dp"
        android:text="@string/tv_2" />

    <Button
        android:id="@+id/gotoKanal3"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_above="@+id/tutorial1"
        android:layout_alignParentLeft="true"
        android:layout_marginBottom="14dp"
        android:text="@string/tv_3" />

    <Button
        android:id="@+id/tutorial1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_above="@+id/tutorial2"
        android:layout_alignParentLeft="true"
        android:layout_marginBottom="14dp"
        android:text="TUTORIALONE" />

    <Button
        android:id="@+id/tutorial2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_above="@+id/gotoKanal6"
        android:layout_alignParentLeft="true"
        android:layout_marginBottom="14dp"
        android:text="-||- 2" />

    <Button
        android:id="@+id/gotoKanal6"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:layout_marginBottom="14dp"
        android:text="@string/tv_6" />

    <Button
        android:id="@+id/gotoKanal1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_above="@+id/gotoKanal2"
        android:layout_alignParentLeft="true"
        android:layout_marginBottom="14dp"
        android:text="@string/tv_1" />

</RelativeLayout>

mainifest Code: Ignore all the .tv

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

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="17" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
        <activity
            android:name="com.Robin.Robin.MainActivity"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.NoTitleBar" >
            <intent-filter >
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
         <activity
            android:name="myMenu"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.Black.NoTitleBar" >
            <intent-filter >
                <action android:name="com.Robin.Robin.CLEARSCREEN"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
        </activity>
          <activity
            android:name=".tutorialOne"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.Black.NoTitleBar" >
            <intent-filter >
                <action android:name="com.Robin.Robin.TUTORIALONE"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
        </activity>
        <activity
            android:name=".tv2"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.Black.NoTitleBar" >
            <intent-filter >
                <action android:name="com.Robin.Robin.tv2"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
        </activity>
        <activity
            android:name=".tv3"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.Black.NoTitleBar" >
            <intent-filter >
                <action android:name="com.Robin.Robin.tv3"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
        </activity>
        <activity
            android:name="com.Robin.Robin.tv4"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.Black.NoTitleBar" >
            <intent-filter >
                <action android:name="com.Robin.Robin.tv4"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
        </activity>
        <activity
            android:name=".tv5"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.Black.NoTitleBar" >
            <intent-filter >
                <action android:name="com.Robin.Robin.tv5"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
        </activity>
        <activity
            android:name=".tv6"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.Black.NoTitleBar" >
            <intent-filter >
                <action android:name="com.Robin.Robin.tv6"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
        </activity>
    </application>

</manifest>

splash Code:

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

    <ImageView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:src="@drawable/default_320x480" />

</LinearLayout>

myMeny.java Code:

 package com.Robin.Robin;

    import android.app.Activity;
    import android.content.Intent;
    import android.os.Bundle;
    import android.view.View;
    import android.widget.Button;


    public class myMenu extends Activity{

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Button bTutorial1 = (Button) findViewById(R.layout.tutorial1);
        bTutorial1.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub
                startActivity(new Intent("com.Robin.Robin.TUTORIALONE"));
            }
        });

            Button bgotoKanal4 = (Button) findViewById(R.id.gotoKanal4);
            bgotoKanal4.setOnClickListener( new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    // TODO Auto-generated method stub
                    startActivity (new Intent ("package com.Robin.Robin.tv4"));


                    Button bgotoKanal2 = (Button) findViewById(R.id.gotoKanal2);
                    bgotoKanal2.setOnClickListener( new View.OnClickListener() {

                        @Override
                        public void onClick(View v) {
                            // TODO Auto-generated method stub
                            startActivity (new Intent ("package com.Robin.Robin.tv2"));


                            Button bgotoKanal3 = (Button) findViewById(R.id.gotoKanal3);
                            bgotoKanal3.setOnClickListener( new View.OnClickListener() {

                                @Override
                                public void onClick(View v) {
                                    // TODO Auto-generated method stub
                                    startActivity (new Intent ("package com.Robin.Robin.tv3"));


                                    Button bgotoKanal1 = (Button) findViewById(R.id.gotoKanal1);
                                    bgotoKanal1.setOnClickListener( new View.OnClickListener() {

                                        @Override
                                        public void onClick(View v) {
                                            // TODO Auto-generated method stub
                                            startActivity (new Intent ("package com.Robin.Robin.tv1"));


                                            Button bgotoKanal5 = (Button) findViewById(R.id.gotoKanal5);
                                            bgotoKanal5.setOnClickListener( new View.OnClickListener() {

                                                @Override
                                                public void onClick(View v) {
                                                     TODO Auto-generated method stub
                                                    startActivity (new Intent ("package com.Robin.Robin.tv5"));


                                                    Button bgotoKanal6 = (Button) findViewById(R.id.gotoKanal6);
                                                    bgotoKanal6.setOnClickListener( new View.OnClickListener() {

                                                        @Override
                                                        public void onClick(View v) {
                                                            // TODO Auto-generated method stub
                                                            startActivity (new Intent ("package com.Robin.Robin.tv6"));


                                                        }
                                                    } );
                                                }
                                            } );
                                        }
                                    } );
                                }
                            } );
                        }
                    } );
                }
            } );



        }



    }

MainActivity code:

package com.Robin.Robin;

import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.app.Activity;


public class MainActivity extends Activity {

MediaPlayer mpSplash;

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.splash);


    mpSplash = MediaPlayer.create(this, R.raw.javaintro);
    mpSplash.start();

    Thread logoTimer = new Thread(){
        public void run(){
            try{
                int logoTimer = 0;
                while(logoTimer < 5000){
                    sleep(100);
                    logoTimer = logoTimer + 100;
                }
                startActivity(new Intent("com.Robin.Robin.CLEARSCREEN"));
            }
            catch (InterruptedException e){
                e.printStackTrace();
            }
            finally{
                finish();
            }
        }


    };
    logoTimer.start();
}

@Override
protected void onDestroy() {
    // TODO Auto-generated method stub
    super.onDestroy();
    mpSplash.release();
}

@Override
protected void onPause() {
    // TODO Auto-generated method stub
    super.onPause();
    mpSplash.pause();
}

@Override
protected void onResume() {
    // TODO Auto-generated method stub
    super.onResume();
    mpSplash.start();
}

@Override
protected void onStart() {
    // TODO Auto-generated method stub
    super.onStart();
}

@Override
protected void onStop() {
    // TODO Auto-generated method stub
    super.onStop();
}
}
  • 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-18T05:16:43+00:00Added an answer on June 18, 2026 at 5:16 am
    Button bTutorial1 = (Button) findViewById(R.layout.tutorial1);
    

    should be

    Button bTutorial1 = (Button) findViewById(R.id.tutorial1);
    

    Because your Button in xml is defined as

     <Button
            android:id="@+id/tutorial1"
            android:layout_width="match_parent"
            ...
    

    Which will be defined in R.id, therefore, you retrieve it as R.id.tutorial1

    In addition to the problem, did you forget to close your OnClickListener?

    bgotoKanal2.setOnClickListener( new View.OnClickListener() {
    
                            @Override
                            public void onClick(View v) {
                                // TODO Auto-generated method stub
                                startActivity (new Intent ("package com.Robin.Robin.tv2"));
                          });//closes the listener, add it to each one.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Windows Phone 7 Search Button I think that all Windows Phone mobiles
When using Console.Read(), the implementation seems to think that as soon as you push
Say I have a menu button called 'Create window' that creates a new window:
I'm new to the mapping plugin and think that I'm missing something obvious. How
I think that the normal behavior of a button like the one below is
I have a problem with Request.QueryString that returns a null value. I think that
I think that handlers in android are tools to get different objects that are
I think that I'm probably not writing lazily instantiated methods/attributes in the most ruby
just think that when I opened my file then when I want to write
I think that this problem can be sorted using reflection (a technology which I'm

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.