爲了在Facebook上分享(同時也是Gmail,短信......)後我已經使用如何在android上使用facebook意圖?
public class ShareActivity extends Activity {
// the button + the editText
Button button= (Button) findViewById(R.id.share);
EditText text= (EditText)findViewById(R.id.edittext);
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_share);
button.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_SEND);
// type of intent
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, text.getText().toString());
ShareActivity.this.startActivity(Intent.createChooser(intent, "Share : "));
}
});
}
}
,但是當我開始我的活動它之後setContentView(R.layout.activity_share);
調用意外
發表您的logcat的? – 2012-07-09 10:12:38