Commit c5ace9e2 by Kunj Gupta

Fix - App is force closed after code reviwe.

parent c667ff9c
......@@ -40,7 +40,6 @@ public class CatalogueApiManager {
stringBuilder.append(Catalogue.Json.URL_PARAM_CATALOGUE_SYSPRM_QUERY_VALUE);
stringBuilder.append("=e0d08b13c3330100c8b837659bba8fb4");
stringBuilder.append("^active=true");
stringBuilder.append("^parent=");
CatalogueLog.d("CatalogueApiManager: getCatalogues: request parameter: "+stringBuilder.toString());
final Retrofit retrofit = RestClient.getInitializedRestAdapter(Constants.API_AUTH_PARAM_USER_NAME, Constants.API_AUTH_PARAM_PASSWORD);
......
......@@ -24,10 +24,8 @@ import butterknife.OnItemClick;
* Created by Kunj on 11/8/16.
*/
public class HomeScreen extends AppCompatActivity {
@BindView(R.id.tool_bar_view)
Toolbar mToolbar;
@BindView(R.id.home_screen_grid_view)
GridView mGridView;
@BindView(R.id.tool_bar_view) Toolbar mToolbar;
@BindView(R.id.home_screen_grid_view) GridView mGridView;
@Override
protected void onCreate(Bundle savedInstanceState) {
......@@ -54,7 +52,6 @@ public class HomeScreen extends AppCompatActivity {
String[] gridValuesArray = getResources().getStringArray(R.array.home_screen_array);
TypedArray gridViewIcons = getResources().obtainTypedArray(R.array.home_screen_icon_array);
HomeScreenAdapter adapter = new HomeScreenAdapter(this, gridValuesArray, gridViewIcons);
gridViewIcons.recycle();
mGridView.setAdapter(adapter);
}
......@@ -66,42 +63,25 @@ public class HomeScreen extends AppCompatActivity {
startActivity(new Intent(HomeScreen.this, ReportIncidentScreen.class));
} else {
DialogUtils.showNoConnectionDialog(HomeScreen.this);
// showErrorDialog(R.string.internet_validation_string);
}
} else if (position == 1) {
if (networkStatus) {
startActivity(new Intent(HomeScreen.this, CatalogueScreen.class));
} else {
// showErrorDialog(R.string.internet_validation_string);
DialogUtils.showNoConnectionDialog(HomeScreen.this);
}
} else if (position == 2) {
if (networkStatus) {
startActivity(new Intent(HomeScreen.this, MyIncidentScreen.class));
} else {
// showErrorDialog(R.string.internet_validation_string);
DialogUtils.showNoConnectionDialog(HomeScreen.this);
}
} else if (position == 3) {
if (networkStatus) {
startActivity(new Intent(HomeScreen.this, MyRequestActivity.class));
} else {
// showErrorDialog(R.string.internet_validation_string);
DialogUtils.showNoConnectionDialog(HomeScreen.this);
}
}
}
// private void showErrorDialog(int message) {
// AlertDialog.Builder builder = new AlertDialog.Builder(this);
// builder.setMessage(message)
// .setCancelable(false)
// .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
// public void onClick(DialogInterface dialog, int id) {
// dialog.dismiss();
// }
// });
// AlertDialog alert = builder.create();
// alert.show();
// }
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment