2012-04-24 95 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上,我忽略了这一点。因此,首先设置电子邮件客户端,然后再调用意图。 尽管如此,系统应该有一个更好的方式来处理这种情况,而不是显示一个奇怪的黑屏。