2012-08-14 75 views
0

我認爲這可能是一個寒冷的問題,我也沒有那麼深入的知識在android中,所以只發布這個問題。考慮我有2屏幕屏幕A和屏幕B.在我有一個微調,因爲如果用戶從微調框中選擇任何1的值,我將重定向到B.這可以正常工作。但是當用戶從A的微調框中選擇任何值時,會產生一個錯覺,即它將要屏幕A,然後它會轉到屏幕BI don不知道這是不能改變的。在android中的屏幕導航

我的代碼:

s1.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() 
       { 
        public void onItemSelected(AdapterView<?> s2, View arg1, 
          int pos, long id) 
        {    
         if(!s1.getItemAtPosition(pos).equals("No recurrence")) 
         { 

Intent intent=new Intent(getApplicationContext(),IncomeStartDate.class); 
         startActivityForResult(intent, 1);  
    } 
    } 
    } 

請提前發佈烏爾ideas..Thanks ..

如果使用微調,然後使用 getSelectedItem()也嘗試籤
+0

你包括實際上重定向到B的代碼? – Sam 2012-08-14 13:02:46

+0

對不起山姆..現在你可以c我的帖子.. – 2012-08-14 13:04:10

+0

請進一步描述你想要發生什麼,發生了什麼。 – Sam 2012-08-14 15:01:27

回答

0

String strCheck=s1.getSelectedItem().toString(); 
System.out.println("check string..."+strCheck); 
if(!strCheck.equals("No recurrence")){ 
} 
+0

謝謝薩米爾Mangroliya ..但仍然我的問題仍然存在.. – 2012-08-14 13:08:25

+0

嘗試調試,如果有任何錯誤,然後發佈它 – 2012-08-14 13:09:39