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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:38:18+00:00 2026-05-30T04:38:18+00:00

public class RenkKorluguTesti extends Activity { /** Called when the activity is first created.

  • 0
  public class RenkKorluguTesti extends Activity {
  /** Called when the activity is first created. */

ImageView imageView1;
EditText editText1=null;
Button button1;
@Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.galeri);

    imageView1 = (ImageView) findViewById(R.id.imageView1);
    editText1 = (EditText) findViewById(R.id.editText1);
    button1 = (Button) findViewById(R.id.button1);


    Gallery gallery = (Gallery) findViewById(R.id.gallery);
    gallery.setAdapter(new ImageAdapter(this));

    gallery.setOnItemClickListener(new OnItemClickListener() {
        public void onItemClick(AdapterView parent, View v, int position, long id) {

            switch(position) {

            case 0:{
                imageView1.setImageResource(R.drawable.plate01); 
                break;
            }
            case 1: imageView1.setImageResource(R.drawable.plate02); break;
            case 2: imageView1.setImageResource(R.drawable.plate03); break;

            }
            //Toast.makeText(RenkKorluguTesti.this, "" + position, Toast.LENGTH_SHORT).show();
        }
    });




   }

public void tikla(View v) {
    if(editText1.getText().toString()=="12")
        editText1.setText("yov");
        //Toast.makeText(RenkKorluguTesti.this, "Birinci testi geçtiniz.",Toast.LENGTH_SHORT).show();


}

public class ImageAdapter extends BaseAdapter {
    int mGalleryItemBackground;
    private Context mContext;

    private Integer[] mImageIds = {
            R.drawable.plate01,
            R.drawable.plate02,
            R.drawable.plate03,

    };

    public ImageAdapter(Context c) {
        mContext = c;
        TypedArray attr = mContext.obtainStyledAttributes(R.styleable.RenkKorluguTesti);
        mGalleryItemBackground = attr.getResourceId(
                R.styleable.RenkKorluguTesti_android_galleryItemBackground, 0);
        attr.recycle();
    }

    public int getCount() {
        return mImageIds.length;
    }

    public Object getItem(int position) {
        return position;
    }

    public long getItemId(int position) {
        return position;
    }

    public View getView(int position, View convertView, ViewGroup parent) {
        ImageView imageView = new ImageView(mContext);

        imageView.setImageResource(mImageIds[position]);
        imageView.setLayoutParams(new Gallery.LayoutParams(150, 100));
        imageView.setScaleType(ImageView.ScaleType.FIT_XY);
        imageView.setBackgroundResource(mGalleryItemBackground);

        return imageView;
    }
}




 }

I want to make a Toast if the text written is equal 12 in EditText box.
I used editText1.getText().toString() method but it seems not working.
What’s wrong? Could you please check public void tikla() method? Thx.

  • 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-30T04:38:20+00:00Added an answer on May 30, 2026 at 4:38 am

    On Java you cannot do this kind of comparation:

    if(editText1.getText().toString()=="12")
    

    You need to do:

    if(editText1.getText().toString().equalsIgnoreCase("12"))
    

    or

    if(editText1.getText().toString().compareTo("12")==0)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

public class MyActivity extends Activity { /** Called when the activity is first created.
public class TestConnection extends Activity { /** Called when the activity is first created.
public class Browser1Activity extends Activity { TextView url; WebView ourBrow; @Override protected void onCreate(Bundle
public class XPBN extends Activity{ private Map _map; @Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState);
public class Offer_Popup extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.offer_popup); //newly
public class ReportView extends JFrame { Connection con=null; void showReport() throws SQLException, ClassNotFoundException, JRException
public class WordDisplay extends Activity { private int level; private int group; private int
public class HomeActivity extends Activity{ // public ArrayList<User> users1 = new ArrayList<User>(); @Override public
public class abc<X extends Z> implements Iterable<X> { protected ArrayList<X> list; public Iterator<X> iterator()
public class SettingsActivity extends PreferenceActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); /*

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.