Browse files

fixed blackout on orientation change.

  • Loading branch information...
1 parent 0557bed commit 59e3d2ef7ad7cbed99f5cd7b8c66fe518f504251 @carlosdotdanger committed Mar 18, 2011
Showing with 39 additions and 0 deletions.
  1. +39 −0 src/com/cloudkick/DashboardActivity.java
View
39 src/com/cloudkick/DashboardActivity.java
@@ -159,6 +159,45 @@ public boolean onOptionsItemSelected(MenuItem item) {
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
setContentView(R.layout.dashboard);
+ queryEditText = (EditText) findViewById(R.id.queryEditText);
+ queryEditText.setOnKeyListener(
+ new OnKeyListener() {
+ public boolean onKey(View v, int keyCode, KeyEvent event) {
+ if(event.getAction() == KeyEvent.ACTION_DOWN){
+ if(keyCode == KeyEvent.KEYCODE_DPAD_CENTER || keyCode == KeyEvent.KEYCODE_ENTER){
+ activeQuery = queryEditText.getText().toString();
+ queryTextView.setText(activeQuery);
+ cancelEdit();
+ reloadAPI();
+ return true;
+ }else if(keyCode == KeyEvent.KEYCODE_BACK){
+ cancelEdit();
+ return true;
+ }
+ }
+ return false;
+ }
+
+ }
+ );
+ queryTextView = (TextView) findViewById(R.id.queryTextView);
+ queryTextView.setOnClickListener(
+ new OnClickListener(){
+ public void onClick(View v) {
+ if(!isEditing){
+ editQuery();
+ }
+ }
+
+ }
+ );
+ queryTextView.setText(activeQuery);
+ dashboardView = (ListView) findViewById(R.id.dashboardListView) ;
+ adapter = new NodesAdapter(this, R.layout.node_item, nodes);
+ dashboardView.setAdapter(adapter);
+ dashboardView.setOnItemClickListener(this);
+ dashboardView.setBackgroundColor(Color.WHITE);
+ reloadAPI();
}
@Override

0 comments on commit 59e3d2e

Please sign in to comment.