FORUMS

New Xposed for Lollipop 5.0 Update Fixes Major Bugs

Senior Recognized Developer rovo89 has patched Xposed for Lollipop 5.0 to … more

Download Sony’s new AOSP-like concept for Xperia Z3

Over in our forums, Recognized Contributor Jozinek has posted a very … more

OnePlus 2 vs Moto X Style: Which is The Better Flagship?

Two big industry names have announced their newest flagship phones within the … more

Making Your Own Xposed Modules Is Easier Than You Think

Close to the heart of XDA is the Xposed Framework by Rovo89. Most of … more

need help for some java errors in edittext widget xml

82 posts
Thanks Meter: 8
 
By Devesh25, Member on 9th January 2014, 09:09 AM
Post Reply Subscribe to Thread Email Thread
13th January 2014, 06:31 PM |#11  
arpitkh96's Avatar
Senior Member
Flag panipat
Thanks Meter: 582
 
Donate to Me
More
Code:
 package com.example.sample;

import android.app.*;
import android.os.*;
import android.view.*;
import android.widget.*;

public class MainActivity extends Activity {
public String word="myword";
public String check;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);



}public void click(View v){

final TextView textview = (TextView) findViewById(R.id.textView1);
final EditText edittext = (EditText) findViewById(R.id.editText1);
check = edittext.getText().toString();

if (check.equals(word)) {

textview.setText("correct");

}else{textview.setText("incorrect");}


}
}
Sent from my GT-S5570 using XDA Premium 4 mobile app
The Following User Says Thank You to arpitkh96 For This Useful Post: [ View ]
 
 
14th January 2014, 09:11 AM |#12  
Devesh25's Avatar
OP Member
Flag Mumbai
Thanks Meter: 8
 
More
Quote:
Originally Posted by arpitkh96

Code:
 package com.example.sample;

import android.app.*;
import android.os.*;
import android.view.*;
import android.widget.*;

public class MainActivity extends Activity {
public String word="myword";
public String check;

@Override
protected void onCreate(Bundle savedInstanceState) {
s....
Sent from my GT-S5570 using XDA Premium 4 mobile app


awesome dude thanks now its working,
can you explain me what is the reason of using (View v) instead of (View view)
14th January 2014, 10:26 AM |#13  
arpitkh96's Avatar
Senior Member
Flag panipat
Thanks Meter: 582
 
Donate to Me
More
Quote:
Originally Posted by Devesh25

awesome dude thanks now its working,
can you explain me what is the reason of using (View v) instead of (View view)


v is same as your view.
Just a variable

Sent from my GT-S5570 using XDA Premium 4 mobile app
14th January 2014, 08:57 PM |#14  
Masrepus's Avatar
Senior Member
Thanks Meter: 93
 
More
You can name it the way you like, the inly important thing is the data type, in this case View

---------------------------------
Phone : My new Nexus 4!
OS:
Pure KitKat 4.4.2 stock, no root, no mods (but only for the first time ;D)
---------------------------------

Gesendet von Tapatalk
The Following User Says Thank You to Masrepus For This Useful Post: [ View ]
16th January 2014, 05:25 PM |#15  
emerals stream's Avatar
Junior Member
Thanks Meter: 3
 
More
you are trying to assign vlaue to a final variable, you can't do this.
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes