@@ -320,9 +320,7 @@ private void hideProgramInfo() {
320
320
private void displayProgramInfo () {
321
321
322
322
try {
323
- String stime = getResources ().getString (R .string .noinfo_str );
324
- String etime = getResources ().getString (R .string .noinfo_str );
325
- String name = getResources ().getString (R .string .noinfo_str );
323
+ String stime = "" , etime = "" , name = "" , finalText = getResources ().getString (R .string .noinfo_str );
326
324
327
325
if (!mInfoArray .get (mInfoIndex ).getAsJsonObject ().get (getResources ().getString (R .string .STIME_STR )).isJsonNull ())
328
326
stime = mInfoArray .get (mInfoIndex ).getAsJsonObject ().get (getResources ().getString (R .string .STIME_STR )).getAsString ();
@@ -334,13 +332,12 @@ private void displayProgramInfo() {
334
332
name = mInfoArray .get (mInfoIndex ).getAsJsonObject ().get (getResources ().getString (R .string .NAME_STR )).getAsString ();
335
333
336
334
337
- if (! stime .equals ( getResources (). getString ( R . string . noinfo_str )))
335
+ if (stime != null && stime .length () > 0 && etime != null && etime . length () > 0 && name != null && name . length () > 0 ) {
338
336
stime = stime .substring (8 , 10 ) + ":" + stime .substring (10 , 12 );
339
-
340
- if (!etime .equals (getResources ().getString (R .string .noinfo_str )))
341
337
etime = etime .substring (8 , 10 ) + ":" + etime .substring (10 , 12 );
338
+ finalText = stime + " ~ " + etime + "\n " + name + "\n " ;
339
+ }
342
340
343
- String finalText = stime + " ~ " + etime + "\n " + name + "\n " ;
344
341
infoView .setText (finalText );
345
342
} catch (Exception ex ) {
346
343
infoView .setText (getResources ().getString (R .string .noinfo_str ));
0 commit comments