Log in or register to post comments

Display button while JSON object url match

March 9, 2014 - 6:18am #1

I need to display a button while JSON object (Bookurl is match).  I used below code.

 private void initApplicationAR()
    {
next=(Button)mUILayout.findViewById(R.id.nextbtn);
        
        
 if(next != null){
      
      next.setVisibility(View.GONE);
       }

Above it working. 

 

JSONObject  jsonObject = new JSONObject(builder.toString());
 
                // Generates a new Book Object with the JSON object data
                mBookData = new Book();
 
Log.v(TAG, "Book thumburl is=" + mBookData.getBookUrl());
 
                if(jsonObject.getString("thumburl").toString().equals("http://test.net/projects/AR/Vuforia/Cloud_Reco/pack.png")){
               
                Log.v(TAG, "Equal book url ");
               
                next.setVisibility(View.VISIBLE);
               
}
 
Above code the Book thumburl is coming proper (http://test.net/projects/AR/Vuforia/Cloud_Reco/pack.png) and the log Equa book url is showing. But next button is not visible then augment bitmap image is not showing only closeButton showing. If i remove this line next.setVisibility(View.VISIBLE); the augment bitmap image showing. 
               

 

Log in or register to post comments