Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
e
os
BlissLauncher
Commits
df4cd2c9
Commit
df4cd2c9
authored
Mar 11, 2018
by
Amit Kumar
Browse files
Fix null pointer exception after uninstalling app
parent
196d8566
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/org/indin/blisslaunchero/DesktopActivity.java
View file @
df4cd2c9
...
...
@@ -577,6 +577,7 @@ public class DesktopActivity extends AppCompatActivity {
* Re-creates the launcher layout based on the data stored in the shared-preferences.
*/
private
void
createUIFromStorage
()
{
Log
.
i
(
TAG
,
"createUIFromStorage: called"
);
Storage
.
StorageData
storageData
=
storage
.
load
();
int
nPages
=
storageData
.
getNPages
();
pages
=
new
ArrayList
<>();
...
...
@@ -607,20 +608,22 @@ public class DesktopActivity extends AppCompatActivity {
for
(
int
j
=
0
;
j
<
pageData
.
length
();
j
++)
{
JSONObject
currentItemData
=
pageData
.
getJSONObject
(
j
);
AppItem
appItem
=
prepareAppFromJSON
(
currentItemData
);
if
(
appItem
.
isFolder
())
{
storedItems
.
addAll
(
appItem
.
getSubApps
());
}
else
{
storedItems
.
add
(
appItem
);
}
if
(
appItem
!=
null
)
{
if
(
appItem
.
isFolder
())
{
storedItems
.
addAll
(
appItem
.
getSubApps
());
}
else
{
storedItems
.
add
(
appItem
);
}
View
appView
=
prepareApp
(
appItem
);
if
(
appView
!=
null
)
{
addAppToPage
(
page
,
appView
);
View
appView
=
prepareApp
(
appItem
);
if
(
appView
!=
null
)
{
addAppToPage
(
page
,
appView
);
}
}
}
}
catch
(
Exception
ignored
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
launchableApps
.
removeAll
(
storedItems
);
...
...
@@ -721,7 +724,6 @@ public class DesktopActivity extends AppCompatActivity {
*/
private
AppItem
prepareAppFromJSON
(
JSONObject
currentItemData
)
throws
Exception
{
String
componentName
=
currentItemData
.
getString
(
"componentName"
);
View
output
=
null
;
if
(
currentItemData
.
getBoolean
(
"isFolder"
))
{
AppItem
folderItem
=
new
AppItem
(
currentItemData
.
getString
(
"folderName"
),
""
,
...
...
@@ -749,11 +751,9 @@ public class DesktopActivity extends AppCompatActivity {
}
folderItem
.
setIcon
(
GraphicsUtil
.
generateFolderIcon
(
this
,
folderItem
));
//output = prepareApp(folderItem);
return
folderItem
;
}
else
{
AppItem
appItem
=
prepareAppItemFromComponent
(
componentName
);
return
appItem
;
return
prepareAppItemFromComponent
(
componentName
);
}
}
...
...
@@ -1018,7 +1018,6 @@ public class DesktopActivity extends AppCompatActivity {
(
2
*
paddingLeft
>
paddingTop
)
?
(
paddingLeft
+
paddingRight
-
paddingTop
)
:
paddingTop
;
Log
.
i
(
TAG
,
"paddingBottom: "
+
paddingBottom
);
ImageView
imageView
=
new
ImageView
(
this
);
imageView
.
setId
(
R
.
id
.
uninstall_app
);
imageView
.
setImageResource
(
R
.
drawable
.
remove_icon_72
);
...
...
Write
Preview
Supports
Markdown
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