2 * wpadebug - wpa_supplicant and Wi-Fi debugging app for Android
3 * Copyright (c) 2013, Jouni Malinen <j@w1.fi>
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
9 package w1.fi.wpadebug;
11 import android.app.Activity;
12 import android.os.Bundle;
13 import android.os.Parcelable;
14 import android.view.MenuItem;
15 import android.content.Intent;
16 import android.widget.TextView;
17 import android.text.method.ScrollingMovementMethod;
18 import android.util.Log;
20 public class DisplayMessageActivity extends Activity
22 private static final String TAG = "wpadebug";
24 String byteArrayHex(byte[] a) {
25 StringBuilder sb = new StringBuilder();
27 sb.append(String.format("%02x", b));
32 public void onCreate(Bundle savedInstanceState)
34 Log.d(TAG, "onCreate");
35 super.onCreate(savedInstanceState);
37 // Get the message from the intent
38 Intent intent = getIntent();
39 String action = intent.getAction();
40 Log.d(TAG, "onCreate: action=" + action);
42 String message = intent.getStringExtra(MainActivity.EXTRA_MESSAGE);
44 TextView textView = new TextView(this);
45 textView.setText(message);
46 textView.setMovementMethod(new ScrollingMovementMethod());
47 setContentView(textView);