Revision eb3b3154 src/com/rackspacecloud/android/ActivityChooser.java
b/src/com/rackspacecloud/android/ActivityChooser.java | ||
---|---|---|
35 | 35 |
setContentView(R.layout.activity_choser); |
36 | 36 |
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); |
37 | 37 |
|
38 |
context = this;
|
|
38 |
context = getApplicationContext();
|
|
39 | 39 |
// Set up buttons |
40 |
ImageButton button1 = (ImageButton) findViewById(R.id.serverbutton);
|
|
41 |
ImageButton button2 = (ImageButton) findViewById(R.id.filesbutton);
|
|
42 |
ImageButton button3 = (ImageButton) findViewById(R.id.loadbalancersbutton);
|
|
40 |
ImageButton serversButton = (ImageButton) findViewById(R.id.serverbutton);
|
|
41 |
ImageButton filesButton = (ImageButton) findViewById(R.id.filesbutton);
|
|
42 |
ImageButton loadBalancersButton = (ImageButton) findViewById(R.id.loadbalancersbutton);
|
|
43 | 43 |
|
44 |
button1.setOnClickListener(myListener);
|
|
45 |
button2.setOnClickListener(myListener);
|
|
46 |
button3.setOnClickListener(myListener);
|
|
44 |
serversButton.setOnClickListener(myListener);
|
|
45 |
filesButton.setOnClickListener(myListener);
|
|
46 |
loadBalancersButton.setOnClickListener(myListener);
|
|
47 | 47 |
} |
48 | 48 |
|
49 | 49 |
View.OnClickListener myListener = new View.OnClickListener() { |
... | ... | |
52 | 52 |
case R.id.serverbutton: |
53 | 53 |
Intent loadServersActivityIntent = new Intent(context, ListServersActivity.class); |
54 | 54 |
startActivity(loadServersActivityIntent); |
55 |
break; |
|
55 | 56 |
case R.id.filesbutton: |
56 | 57 |
Intent loadFilesActivityIntent = new Intent(context, ListContainerActivity.class); |
57 | 58 |
startActivity(loadFilesActivityIntent); |
59 |
break; |
|
58 | 60 |
case R.id.loadbalancersbutton: |
59 |
Intent loadBalancersActivityIntent = new Intent(context, LoadBalancersActivity.class); |
|
61 |
Intent loadBalancersActivityIntent = new Intent(context, ListLoadBalancersActivity.class);
|
|
60 | 62 |
startActivity(loadBalancersActivityIntent); |
63 |
break; |
|
61 | 64 |
default: |
62 |
// Nothing |
|
63 | 65 |
break; |
64 | 66 |
} |
65 | 67 |
} |
66 | 68 |
}; |
67 |
|
|
68 |
protected void showDialog() { |
|
69 |
pDialog = new ProgressDialog(context, R.style.NewDialog); |
|
70 |
// // Set blur to background |
|
71 |
WindowManager.LayoutParams lp = pDialog.getWindow().getAttributes(); |
|
72 |
lp.dimAmount = 0.0f; |
|
73 |
pDialog.getWindow().setAttributes(lp); |
|
74 |
pDialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND); |
|
75 |
pDialog.show(); |
|
76 |
pDialog.setContentView(new ProgressBar(context), new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); |
|
77 |
} |
|
78 | 69 |
} |
Also available in: Unified diff