For example, I try to do something in the separate thread:
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();
}
Why do I have to send the final objects to the arguments list if I want to do something in the new thread?