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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:53:50+00:00 2026-05-27T04:53:50+00:00

I have a popup text view with a next button and onClick I would

  • 0

I have a popup text view with a next button and onClick I would like to switch the content.
This is what I tried …cant get it to work. The error im getting is type mismatch cannot convert from void to int

    package com.jibushi;



    import android.app.Activity;
    import android.os.Bundle;
    import android.os.Handler;
    import android.os.Message;
    import android.view.LayoutInflater;
    import android.view.View;
    import android.view.View.OnClickListener;
    import android.view.ViewGroup;
    import android.widget.Button;
    import android.widget.TextView;

    public class LessonsShell extends Activity{
    private static final int MESSAGE_SHOW_POPUP=7;
    private static final long TIME_DELAY=1000;//1 seconds
    private View view;
    private Button nextButton;
    private Button skipButton;
    private TextView nextSwitch;
    private int tutStrings;
    private int tutStrings2;
    private int tutStrings3;
    private Handler handler = new Handler() {
       public void handleMessage(Message msg) {
          switch(msg.what) {
            case MESSAGE_SHOW_POPUP:
               view();
               break;
           }
       };
    };

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

        setContentView(R.layout.lessons);
        //this will send a message to the handler to display the popup after 1 seconds.
        handler.sendEmptyMessageDelayed(MESSAGE_SHOW_POPUP,TIME_DELAY);

        nextSwitch = (TextView) findViewById(R.id.lessonsDialog);
        tutStrings = nextSwitch.setText(R.string.lessons_introduction); //type mismatch cannot convert from void to int
        tutStrings2 = nextSwitch.setText(R.string.lessons_introduction2); //type mismatch cannot convert from void to int
        tutStrings3 = nextSwitch.setText(R.string.lessons_introduction3); //type mismatch cannot convert from void to int

        this.nextButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
                switch (v.getId()) {
                    case tutStrings:
                    nextSwitch.setText(R.string.lessons_introduction2);
                    break;

                    case tutStrings2:
                    nextSwitch.setText(R.string.lessons_introduction3);
                    break;
                }
            }
        });

    }

    private void view() {
    // TODO Auto-generated method stub
     ViewGroup parent = (ViewGroup) findViewById(R.id.lessons_bg);
     view = LayoutInflater.from(getBaseContext()).inflate(R.layout.lessons_dialog,                 null);
     parent.addView(view);
    }

    public Button getSkipButton() {
        return skipButton;
    }

    public void setSkipButton(Button skipButton) {
        this.skipButton = skipButton;
        skipButton.findViewById(R.id.skip_button);


    }

    public Button getNextButton() {
        return nextButton;
    }

    public void setNextButton(Button nextButton) {
        this.nextButton = nextButton;
        nextButton.findViewById(R.id.next_button);
    }


    }

Yeah, lack of research. Didn’t know about string arrays…finally got it!

    package com.jibushi;



    import android.app.Activity;
    import android.content.res.Resources;
    import android.os.Bundle;
    import android.os.Handler;
    import android.os.Message;
    import android.view.LayoutInflater;
    import android.view.View;
    import android.view.ViewGroup;
    import android.widget.Button;
    import android.widget.TextView;

    public class LessonsShell extends Activity{
    private static final int MESSAGE_SHOW_POPUP=7;
    private static final long TIME_DELAY=1000;//1 seconds
    private View view;

    private int count = 0;
    private TextView lessonsDialog;
    private String[] lessonDialogString;

    private Handler handler = new Handler() {
       public void handleMessage(Message msg) {
          switch(msg.what) {
            case MESSAGE_SHOW_POPUP:
               view();
               break;
           }
       };
    };

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

    setContentView(R.layout.lessons);
    //this will send a message to the handler to display the popup after 1 seconds.
    handler.sendEmptyMessageDelayed(MESSAGE_SHOW_POPUP,TIME_DELAY);

    }

    private void view() {
    // TODO Auto-generated method stub
     ViewGroup parent = (ViewGroup) findViewById(R.id.lessons_bg);
     view = LayoutInflater.from(getBaseContext()).inflate(R.layout.lessons_dialog,                 null);
     parent.addView(view);

     lessonsDialog = (TextView) findViewById(R.id.lessonsDialog);

     Resources res = getResources();
     myString = res.getStringArray(R.array.lessons_dialog_array); 

     Button nextButton = (Button) findViewById(R.id.next_button);
     nextButton.setOnClickListener(new View.OnClickListener() {
         public void onClick(View view) {
             if (count < lessonDialogString.length) {
                 lessonsDialog.setText(lessonDialogString[count]);
                 count++;
             }
         }
     });

    }
    }
  • 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-27T04:53:51+00:00Added an answer on May 27, 2026 at 4:53 am

    Sorry, lack of research on my part. Used string-array.. works perfectly!

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

Sidebar

Related Questions

i have a text held in my main view and a button next to
I have a Popup defined like this: <Popup Name=myPopup StaysOpen=True Placement=Bottom PlacementRectangle=0,20,0,20 PlacementTarget={Binding ElementName=myPopupAnchor}>
I have an android loyout like this: <ScrollView android:layout_width=fill_parent android:layout_height=fill_parent android:id=@+id/scrollview> <TextView android:id=@+id/text android:layout_width=wrap_content
I have a list view of a thumbnail and text next to each other.
I like to have a popup modal dialog that need to show the list
I have a modal popup that initially shows some content but expands a div
I have this code in my view.. <span class=bold>Comment: <%=Html.TextAreaFor(model => model.Comment, new {
I have subclassed Dialog in order to display a popup. This dialog contains a
Background: I have a popup which lets me create a company, this popup has
I am wondering how would I do this with like jQuery ajax. Right now

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.