summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn/VPNPreferences.java
blob: a2c8407c309e686efab1fb88499c5e489de5a904 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package de.blinkt.openvpn;

import java.util.List;

import android.os.Bundle;
import android.preference.PreferenceActivity;


public class VPNPreferences extends PreferenceActivity {

	private String mProfileUUID;

	public VPNPreferences() {
		super();
	
	}
	


	
	@Override
	protected void onStop() {
		super.onStop();
	};
	
	
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		mProfileUUID = getIntent().getStringExtra(getPackageName() + ".profileUUID");
		VpnProfile profile = ProfileManager.get(this,mProfileUUID);
		if(profile!=null) {
			setTitle(getString(R.string.edit_profile_title, profile.getName()));
		}
		super.onCreate(savedInstanceState);
	}
	
	
	@Override
	public void onBuildHeaders(List<Header> target) {
		loadHeadersFromResource(R.xml.vpn_headers, target); 
		for (Header header : target) {
			if(header.fragmentArguments==null)
				header.fragmentArguments = new Bundle();
			header.fragmentArguments.putString(getPackageName() + ".profileUUID",mProfileUUID);
		}
	}
	
	@Override
	public void onBackPressed() {
		setResult(RESULT_OK, getIntent());
		super.onBackPressed();
	}
}