例如,我尝试在单独的线程中做一些事情:
public void shareQuote(final Context context, final ArrayList<Quote> quotes, final int number) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
Toast warningWindow = Toast.makeText(context, context.getString(R.string.shareWarning), Toast.LENGTH_SHORT);
} else {
new Thread(new Runnable() {
@Override
public void run() {
// Creates new intent for sharing
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType(SHARE_TYPE_TEXT);
String subject = context.getString(R.string.quotes_author);
String sharingQuote = "\"" + quotes.get(number).getText() + "\"" + "\n";
}
}).start();
}
如果我想在新线程中做某事,为什么必须将最终对象发送到参数列表?