2012-04-24 49 views
1

我在郵件屏幕滾動下到谷底

ImageButton mail=(ImageButton)findViewById(R.id.mailgps); 
    mail.setOnClickListener(new View.OnClickListener() { 

     @Override 
     public void onClick(View v) { 
      setContentView(R.layout.mail); 
      Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); 
      // TODO Auto-generated method stub 
      emailIntent.setType("text/plain"); 
      String emailto[]={"myemail"}; 
      String subject="GPS User Report"; 
      String body="Welcome to Samarth Reporting service.Did you see an untracked Dustbin\n.A dustbin not at the right place??\nWant to suggest placement of a dustbin here.\nGo ahead we are all ears.\n.Your present location is\n Latitude: "; 
      body=body + "28.67890" + " and Longitudes: " + "79.78965"; 
      body=body + "\n\nTell us more."; 
      emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,emailto); 
      emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,subject); 
      emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,body); 

      startActivity(emailIntent); 



     } 
    }); 

調用郵件意圖和獲取屏幕像這裏面忽略了EXTRA_EMAIL屬性以及EXTRA_SUBJECT然後身體出現在非常bottom.How我能糾正這一點嗎?

enter image description here

回答

0

那麼這是一個非常愚蠢的事情。 就像我之前使用另一臺AVD一樣,我的電子郵件客戶端設置很好,但是在新的AVD上,我忽略了這一點。因此,首先設置電子郵件客戶端,然後再調用意圖。 儘管如此,系統應該有一個更好的方式來處理這種情況,而不是顯示一個奇怪的黑屏。