检查Parse.com类是否为(未定义)

时间:2016-01-08 08:48:16

标签: java android parse-platform undefined

我正试图捕捉异常。我认为检查String是否为空会有所帮助,但它似乎不起作用。我类中对象的实际列中的值是“(undefined)”。它似乎是默认的。如何明确检查是否未定义?

notifications.getString(ParseConstants.KEY_FEED_TYPE).isEmpty()

抬起头来。以下内容也不起作用:

notifications.getString(ParseConstants.KEY_FEED_TYPE).equals("(undefined)");

2 个答案:

答案 0 :(得分:1)

正在使用Android默认功能(如

)进行检查
if (!TextUtils.isEmpty(notifications.get(ParseConstants.KEY_FEED_TYPE))) {
        // its not null value success
    } else {
        // here getting to null value Fail
    }

答案 1 :(得分:0)

我做了以下事情。而不是查找字符串(在这种情况下,字段条目将是真正的空,而不是if (notifications.get(ParseConstants.KEY_FEED_TYPE) != null) { // Do something. } else { // Do something else. } ),我检查了从getString中删除字符串后对象是否为空。

$(document).ready(function() {
    // -----------------------------------------------------------------------
  $("#example").on('click','tbody tr',function () { 
      var age = Math.floor(Math.random() * 99) + 1; // 1..99  
      var line = $('#example').dataTable().fnGetPosition(this);    

      $('#example').dataTable().fnUpdate(age, line, 4); // 4=column Age
  });    
  // -----------------------------------------------------------------------      
  $('#example').DataTable(); // initialize
} );
相关问题