Advertisement
Guest User

Untitled

a guest
Aug 28th, 2014
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.08 KB | None | 0 0
  1.     View.OnClickListener searchButtonClicked = new View.OnClickListener() {
  2.         public void onClick(View v) {
  3.             Log.d(TAG, "works");
  4.  
  5.             CheckConnection connection = new CheckConnection();
  6.  
  7.             boolean isOnline = connection.isConnected();
  8.  
  9.             //get text field value and pass it to the get method
  10.             EditText textValue = (EditText)findViewById(R.id.editText2);
  11.             String result = textValue.getText().toString();
  12.             Log.d(TAG, "result: " + result);
  13.  
  14.             try {
  15.  
  16.                 URL queryURL = new URL(createURL(result));
  17.                 Log.d(TAG,"right before if");
  18.                 if (isOnline){
  19.                     Log.d(TAG,"connected!!!!!");
  20.                     new fetchInstagramData().execute(queryURL);
  21.                 }else{
  22.                     Log.d(TAG,"connection null");
  23.                 }
  24.  
  25.             }catch (Exception e){
  26.                 Log.e(TAG,"Illegal State Exception: " + e.toString());
  27.             }
  28.             //Log.d(TAG,result);
  29.             hideKeyboard();
  30.         }
  31.     };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement