final EditText mNum=(EditText)findViewById(R.id.edittxt);
final EditText mLines=(EditText)findViewById(R.id.edittxt3);
final EditText mTitle=(EditText)findViewById(R.id.edittxt4);
final EditText mPage=(EditText)findViewById(R.id.edittxt5);
final Calendar c = Calendar.getInstance();
mYear = c.get(Calendar.YEAR);
mMonth = c.get(Calendar.MONTH);
mDay = c.get(Calendar.DAY_OF_MONTH);
final String date= Integer.toString(mDay) +"/"+ Integer.toString(mMonth+1) +"/"+ Integer.toString(mYear);
Button read=(Button)findViewById(R.id.btn1);
read.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
final String words=mNum.getText().toString().trim();
final String lines=mLines.getText().toString().trim();
final String page=mPage.getText().toString().trim();
final String title= mTitle.getText().toString();
if((mNum.length() == 0) || (words.equals("0")))
{
mNum.setError("Error");
}
else if((mLines.length()==0) || (lines.equals("0")))
{
mLines.setError("Error");
}
else if(mTitle.length()==0)
{
mTitle.setError("Error");
}
else if((mPage.length()==0) || (page.equals("0")))
{
mPage.setError("Error");
}
final EditText mLines=(EditText)findViewById(R.id.edittxt3);
final EditText mTitle=(EditText)findViewById(R.id.edittxt4);
final EditText mPage=(EditText)findViewById(R.id.edittxt5);
final Calendar c = Calendar.getInstance();
mYear = c.get(Calendar.YEAR);
mMonth = c.get(Calendar.MONTH);
mDay = c.get(Calendar.DAY_OF_MONTH);
final String date= Integer.toString(mDay) +"/"+ Integer.toString(mMonth+1) +"/"+ Integer.toString(mYear);
Button read=(Button)findViewById(R.id.btn1);
read.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
final String words=mNum.getText().toString().trim();
final String lines=mLines.getText().toString().trim();
final String page=mPage.getText().toString().trim();
final String title= mTitle.getText().toString();
if((mNum.length() == 0) || (words.equals("0")))
{
mNum.setError("Error");
}
else if((mLines.length()==0) || (lines.equals("0")))
{
mLines.setError("Error");
}
else if(mTitle.length()==0)
{
mTitle.setError("Error");
}
else if((mPage.length()==0) || (page.equals("0")))
{
mPage.setError("Error");
}
@Girsh Try to upload few screen shots from your example application so new developer like me can understand how it will look like? Thanks.
ReplyDelete