Updated through tag hostap_2_5 from git://w1.fi/hostap.git
[mech_eap.git] / libeap / wpadebug / src / w1 / fi / wpadebug / WpaCredEditActivity.java
1 /*
2  * wpadebug - wpa_supplicant and Wi-Fi debugging app for Android
3  * Copyright (c) 2013, Jouni Malinen <j@w1.fi>
4  *
5  * This software may be distributed under the terms of the BSD license.
6  * See README for more details.
7  */
8
9 package w1.fi.wpadebug;
10
11 import android.app.Activity;
12 import android.content.Intent;
13 import android.os.Bundle;
14 import android.view.View;
15 import android.widget.EditText;
16
17 public class WpaCredEditActivity extends Activity
18 {
19     @Override
20     public void onCreate(Bundle savedInstanceState)
21     {
22         super.onCreate(savedInstanceState);
23         setContentView(R.layout.cred_edit);
24     }
25
26     public void credSave(View view)
27     {
28         Intent data = new Intent();
29         EditText edit;
30
31         edit = (EditText) findViewById(R.id.cred_edit_username);
32         data.putExtra("username", edit.getText().toString());
33
34         edit = (EditText) findViewById(R.id.cred_edit_realm);
35         data.putExtra("realm", edit.getText().toString());
36
37         edit = (EditText) findViewById(R.id.cred_edit_password);
38         data.putExtra("password", edit.getText().toString());
39
40         edit = (EditText) findViewById(R.id.cred_edit_domain);
41         data.putExtra("domain", edit.getText().toString());
42
43         edit = (EditText) findViewById(R.id.cred_edit_imsi);
44         data.putExtra("imsi", edit.getText().toString());
45
46         setResult(Activity.RESULT_OK, data);
47         finish();
48     }
49
50     public void credCancel(View view)
51     {
52         setResult(Activity.RESULT_CANCELED);
53         finish();
54     }
55 }