Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Krishna Vemulavada
/
vera_2.1_app
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c5ace9e2
authored
Sep 08, 2016
by
Kunj Gupta
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Fix - App is force closed after code reviwe.
parent
c667ff9c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
23 deletions
app/src/main/java/com/vsoft/uoflservicenow/api/managers/CatalogueApiManager.java
app/src/main/java/com/vsoft/uoflservicenow/ui/HomeScreen.java
app/src/main/java/com/vsoft/uoflservicenow/api/managers/CatalogueApiManager.java
View file @
c5ace9e2
...
@@ -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
);
...
...
app/src/main/java/com/vsoft/uoflservicenow/ui/HomeScreen.java
View file @
c5ace9e2
...
@@ -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();
// }
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment