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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:28:36+00:00 2026-06-07T07:28:36+00:00

Can someone tell me why it doesn’t work? The eclipse doesn’t show any erros

  • 0

Can someone tell me why it doesn’t work? The eclipse doesn’t show any erros when i compile but the android emulator crashes at line 76: ” intrebare.setText(“Intrebarea ” + i+1 + “: ” + intrebari[i]);” The entire program looks like this:

package com.example.testpsiho1;
import android.os.Bundle;
import android.app.Activity;
import android.content.pm.ActivityInfo;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.app.AlertDialog;
import android.support.v4.app.NavUtils;
public class TestPsiho extends Activity {
 public static Button btna, btnb, btnc;
 public static TextView titlu, intrebare;
 public static String[] intrebari = {"intrebare 1", "intrebare 2", "intrebare 3"};
 public static String[] raspunsuriA = {"rasp a 1", "rasp a 2", "rasp a 3"};
 public static String[] raspunsuriB = {"rasp b 1", "rasp b 2", "rasp b 3"};
 public static String[] raspunsuriC = {"rasp c 1", "rasp c 2", "rasp c 3"};
 public static String[] rezultate = {"rezultatul pentru cele mai multe rasp a", "rezultatul pentru cele mai multe rasp b", "rezultatul pentru cele mai multe rasp c"};
 public static int a=0, b=0, c=0, i=1;
 public static String rezultat="";
 AlertDialog.Builder alert;
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_test_psiho);
    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);

}
public void click(View v){
        btna=(Button)findViewById(R.id.btna);
        btnb=(Button)findViewById(R.id.btnb);
        btnc=(Button)findViewById(R.id.btnc);
        intrebare=(TextView)findViewById(R.id.intrebare);
        if(i<4){
        if (v.equals(btna)) a++;
        if (v.equals(btna)) b++;
        if (v.equals(btna)) c++;

         intrebare.setText("Intrebarea " + i+1 + ": " + intrebari[i]);
         btna.setText(raspunsuriA[i]);
         btnb.setText(raspunsuriB[i]);
         btnc.setText(raspunsuriC[i]);

        }
        if(i==4){

            if (a >= b && a >= c){
                alert=new AlertDialog.Builder(this);

                  alert.setTitle("bla bla bla");
            }

    }
        i++;

}
}
  • 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-07T07:28:38+00:00Added an answer on June 7, 2026 at 7:28 am

    It doesn’t work because your “i+1” is assumed as a string.

    I don’t know if its the best option but you can resolve your issue replacing your setText method with :

    intrebare.setText(String.formatString("Intrebarea %s: ", i+1).concat(intrebari[i]));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can someone please tell me why this doesn't work? I'm trying to show and
Can someone tell me, why the opendir doesn't work? #!/usr/bin/env perl6 use v6; my
Can someone tell me why this program doesn't enumerate any items? Does it have
Can someone tell me why this doesn't work: $(document).ready(function() { $(#cookie).text(expanded); //panel toggle $(.btn-slide).click(function()
Can someone tell me why this doesn't work? -(IBAction) website_btn { [myAppDelegate viewGallery]; }
Can someone tell me why the code below doesn't work. I think my theory
Can someone tell me why in the world this doesn't work? The code below
Hi can someone tell me why this doesn't work? It runs on forever and
Can someone tell me why this processes all the files and then does it
Can someone tell me how to modify this regex to allow periods in a

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.