Avoid NPE on null action

git-svn-id: https://zxing.googlecode.com/svn/trunk@2262 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2012-04-26 16:34:51 +00:00
parent 9ad25e25b7
commit 6573f932a1

View file

@ -63,16 +63,17 @@ public final class EncodeActivity extends Activity {
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
Intent intent = getIntent();
if (intent != null) {
if (intent == null) {
finish();
} else {
String action = intent.getAction();
if (action.equals(Intents.Encode.ACTION) || action.equals(Intent.ACTION_SEND)) {
if (Intents.Encode.ACTION.equals(action) || Intent.ACTION_SEND.equals(action)) {
setContentView(R.layout.encode);
return;
} else {
finish();
}
}
finish();
}
@Override