2014-02-26 03:53:12 +00:00
|
|
|
package org.thoughtcrime.securesms;
|
|
|
|
|
|
|
|
import android.os.Bundle;
|
2014-06-27 21:34:51 +00:00
|
|
|
import android.support.v4.app.FragmentTransaction;
|
|
|
|
import android.support.v7.app.ActionBarActivity;
|
2014-06-29 03:40:57 +00:00
|
|
|
import android.view.MenuItem;
|
2014-02-26 03:53:12 +00:00
|
|
|
import android.widget.Toast;
|
|
|
|
|
2014-06-27 21:34:51 +00:00
|
|
|
import org.whispersystems.libpastelog.SubmitLogFragment;
|
2014-02-26 03:53:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Activity for submitting logcat logs to a pastebin service.
|
|
|
|
*/
|
2014-06-27 21:34:51 +00:00
|
|
|
public class LogSubmitActivity extends ActionBarActivity implements SubmitLogFragment.OnLogSubmittedListener {
|
2014-02-26 03:53:12 +00:00
|
|
|
private static final String TAG = LogSubmitActivity.class.getSimpleName();
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void onCreate(Bundle icicle) {
|
|
|
|
super.onCreate(icicle);
|
|
|
|
setContentView(R.layout.log_submit_activity);
|
|
|
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
2014-06-27 21:34:51 +00:00
|
|
|
SubmitLogFragment fragment = SubmitLogFragment.newInstance();
|
|
|
|
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
|
|
|
|
transaction.replace(R.id.fragment_container, fragment);
|
|
|
|
transaction.commit();
|
2014-02-26 03:53:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void onResume() {
|
|
|
|
super.onResume();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean onOptionsItemSelected(MenuItem item) {
|
|
|
|
super.onOptionsItemSelected(item);
|
|
|
|
switch (item.getItemId()) {
|
|
|
|
case android.R.id.home:
|
|
|
|
finish();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2014-06-27 21:34:51 +00:00
|
|
|
@Override
|
|
|
|
public void onSuccess() {
|
|
|
|
Toast.makeText(getApplicationContext(), R.string.log_submit_activity__thanks, Toast.LENGTH_LONG).show();
|
|
|
|
finish();
|
2014-02-26 03:53:12 +00:00
|
|
|
}
|
|
|
|
|
2014-06-27 21:34:51 +00:00
|
|
|
@Override
|
|
|
|
public void onFailure() {
|
|
|
|
Toast.makeText(getApplicationContext(), R.string.log_submit_activity__log_fetch_failed, Toast.LENGTH_LONG).show();
|
|
|
|
finish();
|
2014-02-26 03:53:12 +00:00
|
|
|
}
|
|
|
|
|
2014-06-27 21:34:51 +00:00
|
|
|
@Override
|
|
|
|
public void onCancel() {
|
|
|
|
finish();
|
2014-02-26 03:53:12 +00:00
|
|
|
}
|
|
|
|
}
|