X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=libeap%2Fwpadebug%2Fsrc%2Fw1%2Ffi%2Fwpadebug%2FDisplayMessageActivity.java;fp=libeap%2Fwpadebug%2Fsrc%2Fw1%2Ffi%2Fwpadebug%2FDisplayMessageActivity.java;h=28ef85f39169c4563b0f6630fe0449b87822880e;hb=4f319dde67a76fe0aaf33f6d2788968012584ada;hp=0000000000000000000000000000000000000000;hpb=ed09b5e64dd485851310307979d5eed14678087b;p=mech_eap.git diff --git a/libeap/wpadebug/src/w1/fi/wpadebug/DisplayMessageActivity.java b/libeap/wpadebug/src/w1/fi/wpadebug/DisplayMessageActivity.java new file mode 100644 index 0000000..28ef85f --- /dev/null +++ b/libeap/wpadebug/src/w1/fi/wpadebug/DisplayMessageActivity.java @@ -0,0 +1,49 @@ +/* + * wpadebug - wpa_supplicant and Wi-Fi debugging app for Android + * Copyright (c) 2013, Jouni Malinen + * + * This software may be distributed under the terms of the BSD license. + * See README for more details. + */ + +package w1.fi.wpadebug; + +import android.app.Activity; +import android.os.Bundle; +import android.os.Parcelable; +import android.view.MenuItem; +import android.content.Intent; +import android.widget.TextView; +import android.text.method.ScrollingMovementMethod; +import android.util.Log; + +public class DisplayMessageActivity extends Activity +{ + private static final String TAG = "wpadebug"; + + String byteArrayHex(byte[] a) { + StringBuilder sb = new StringBuilder(); + for (byte b: a) + sb.append(String.format("%02x", b)); + return sb.toString(); + } + + @Override + public void onCreate(Bundle savedInstanceState) + { + Log.d(TAG, "onCreate"); + super.onCreate(savedInstanceState); + + // Get the message from the intent + Intent intent = getIntent(); + String action = intent.getAction(); + Log.d(TAG, "onCreate: action=" + action); + + String message = intent.getStringExtra(MainActivity.EXTRA_MESSAGE); + + TextView textView = new TextView(this); + textView.setText(message); + textView.setMovementMethod(new ScrollingMovementMethod()); + setContentView(textView); + } +}