开发者

problem with android UI

开发者 https://www.devze.com 2023-02-19 06:44 出处:网络
hi the following image is UI of my app in this i have placed rounded table in middle. In that the first three AAAA, BBBB, CCCC are of edit boxes and the other 2 are of textview. When i touch the firs

hi the following image is UI of my app

problem with android UI

in this i have placed rounded table in middle. In that the first three AAAA, BBBB, CCCC are of edit boxes and the other 2 are of textview. When i touch the first 3 edit text the keyboard gets opened.

When i click the last two text view the "date picker" gets opened. Now i want to display the date which i set must be viewed in the places of DATE1 and DATE2(TextView boxes). but when i try this it gets crashed.

how to solve this please help me....

following is the code of date picker

{
private void updateDisplay()
 {
        this.mDateDisplay.setText(
                new StringBuilder()
                        // Month is 0 based so add 1
                        .appe开发者_JAVA百科nd(mMonth + 1).append("-")
                        .append(mDay).append("-")
                        .append(mYear).append("-"));
    }

     private DatePickerDialog.OnDateSetListener mDateSetListener = new DatePickerDialog.OnDateSetListener()
     {
         public void onDateSet(DatePicker view, int year,
                               int monthOfYear, int dayOfMonth) {
             mYear = year;
             mMonth = monthOfYear;
             mDay = dayOfMonth;
             updateDisplay();
         }
     };


     @Override
     protected Dialog onCreateDialog(int id) {
        switch (id) {
        case DATE_DIALOG_ID:
           return new DatePickerDialog(this,
                     mDateSetListener,
                     mYear, mMonth, mDay);
        }
        return null;
     }
}


Try the same for next TextView as` secondtextviewobject.setText(blaa).

Also check whether out convert Id as View

(i.e) TextView tv=(TextView)findviewById(R.id.textview2);

0

精彩评论

暂无评论...
验证码 换一张
取 消