fixed crash for no author
This commit is contained in:
@@ -2,4 +2,6 @@
|
||||
* Fixed NPE if the device is offline
|
||||
* Fixed missing whitespace in share_text string
|
||||
* Changed about fragment appearance
|
||||
* Fixed NPE when rotating device in BookDetail fragment by retaining it
|
||||
* Fixed NPE when rotating device in BookDetail fragment by retaining it
|
||||
|
||||
* Fixed crash if a book has no author
|
||||
@@ -169,7 +169,10 @@ public class AddBook extends Fragment implements LoaderManager.LoaderCallbacks<C
|
||||
((TextView) rootView.findViewById(R.id.bookSubTitle)).setText(bookSubTitle);
|
||||
|
||||
String authors = data.getString(data.getColumnIndex(AlexandriaContract.AuthorEntry.AUTHOR));
|
||||
String[] authorsArr = authors.split(",");
|
||||
if(authors == null)
|
||||
authors = "";
|
||||
String[] authorsArr;
|
||||
authorsArr = authors.split(",");
|
||||
((TextView) rootView.findViewById(R.id.authors)).setLines(authorsArr.length);
|
||||
((TextView) rootView.findViewById(R.id.authors)).setText(authors.replace(",","\n"));
|
||||
String imgUrl = data.getString(data.getColumnIndex(AlexandriaContract.BookEntry.IMAGE_URL));
|
||||
|
||||
Reference in New Issue
Block a user