Commit c5ace9e2 by Kunj Gupta

Fix - App is force closed after code reviwe.

parent c667ff9c
...@@ -40,7 +40,6 @@ public class CatalogueApiManager { ...@@ -40,7 +40,6 @@ public class CatalogueApiManager {
stringBuilder.append(Catalogue.Json.URL_PARAM_CATALOGUE_SYSPRM_QUERY_VALUE); stringBuilder.append(Catalogue.Json.URL_PARAM_CATALOGUE_SYSPRM_QUERY_VALUE);
stringBuilder.append("=e0d08b13c3330100c8b837659bba8fb4"); stringBuilder.append("=e0d08b13c3330100c8b837659bba8fb4");
stringBuilder.append("^active=true"); stringBuilder.append("^active=true");
stringBuilder.append("^parent=");
CatalogueLog.d("CatalogueApiManager: getCatalogues: request parameter: "+stringBuilder.toString()); CatalogueLog.d("CatalogueApiManager: getCatalogues: request parameter: "+stringBuilder.toString());
final Retrofit retrofit = RestClient.getInitializedRestAdapter(Constants.API_AUTH_PARAM_USER_NAME, Constants.API_AUTH_PARAM_PASSWORD); final Retrofit retrofit = RestClient.getInitializedRestAdapter(Constants.API_AUTH_PARAM_USER_NAME, Constants.API_AUTH_PARAM_PASSWORD);
......
...@@ -24,10 +24,8 @@ import butterknife.OnItemClick; ...@@ -24,10 +24,8 @@ import butterknife.OnItemClick;
* Created by Kunj on 11/8/16. * Created by Kunj on 11/8/16.
*/ */
public class HomeScreen extends AppCompatActivity { public class HomeScreen extends AppCompatActivity {
@BindView(R.id.tool_bar_view) @BindView(R.id.tool_bar_view) Toolbar mToolbar;
Toolbar mToolbar; @BindView(R.id.home_screen_grid_view) GridView mGridView;
@BindView(R.id.home_screen_grid_view)
GridView mGridView;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
...@@ -54,7 +52,6 @@ public class HomeScreen extends AppCompatActivity { ...@@ -54,7 +52,6 @@ public class HomeScreen extends AppCompatActivity {
String[] gridValuesArray = getResources().getStringArray(R.array.home_screen_array); String[] gridValuesArray = getResources().getStringArray(R.array.home_screen_array);
TypedArray gridViewIcons = getResources().obtainTypedArray(R.array.home_screen_icon_array); TypedArray gridViewIcons = getResources().obtainTypedArray(R.array.home_screen_icon_array);
HomeScreenAdapter adapter = new HomeScreenAdapter(this, gridValuesArray, gridViewIcons); HomeScreenAdapter adapter = new HomeScreenAdapter(this, gridValuesArray, gridViewIcons);
gridViewIcons.recycle();
mGridView.setAdapter(adapter); mGridView.setAdapter(adapter);
} }
...@@ -66,42 +63,25 @@ public class HomeScreen extends AppCompatActivity { ...@@ -66,42 +63,25 @@ public class HomeScreen extends AppCompatActivity {
startActivity(new Intent(HomeScreen.this, ReportIncidentScreen.class)); startActivity(new Intent(HomeScreen.this, ReportIncidentScreen.class));
} else { } else {
DialogUtils.showNoConnectionDialog(HomeScreen.this); DialogUtils.showNoConnectionDialog(HomeScreen.this);
// showErrorDialog(R.string.internet_validation_string);
} }
} else if (position == 1) { } else if (position == 1) {
if (networkStatus) { if (networkStatus) {
startActivity(new Intent(HomeScreen.this, CatalogueScreen.class)); startActivity(new Intent(HomeScreen.this, CatalogueScreen.class));
} else { } else {
// showErrorDialog(R.string.internet_validation_string);
DialogUtils.showNoConnectionDialog(HomeScreen.this); DialogUtils.showNoConnectionDialog(HomeScreen.this);
} }
} else if (position == 2) { } else if (position == 2) {
if (networkStatus) { if (networkStatus) {
startActivity(new Intent(HomeScreen.this, MyIncidentScreen.class)); startActivity(new Intent(HomeScreen.this, MyIncidentScreen.class));
} else { } else {
// showErrorDialog(R.string.internet_validation_string);
DialogUtils.showNoConnectionDialog(HomeScreen.this); DialogUtils.showNoConnectionDialog(HomeScreen.this);
} }
} else if (position == 3) { } else if (position == 3) {
if (networkStatus) { if (networkStatus) {
startActivity(new Intent(HomeScreen.this, MyRequestActivity.class)); startActivity(new Intent(HomeScreen.this, MyRequestActivity.class));
} else { } else {
// showErrorDialog(R.string.internet_validation_string);
DialogUtils.showNoConnectionDialog(HomeScreen.this); 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