Code example for Gson

Methods: fromJson

0
 
		@Override 
		protected void onPostExecute(String response) {
			if (!response.isEmpty()) {
				try { 
					BasicStatusResult result = gson.fromJson(response.toString(), BasicStatusResult.class);
 
					if (result.isSuccess()) {
						// save the entered name 
						nickname = user;
						((BruinChat) getApplicationContext()).setSavedName(nickname);
						((BruinChat) getApplicationContext()).setUniqueAndroidID(uniqueAndroidID);
 
						Intent intent = new Intent(context, RoomsActivity.class);
						startActivity(intent);
					} else { 
						showToast("Sorry, the name \"" + user + "\" is already taken!");
						clicked = false;
					} 
				} catch (JsonParseException e) {
Contextual code suggestions in your IDE  Get Codota for Java