Expected a Map while deserializing, but got a class java.lang.Long
<p>I have been getting this error 
"Expected a Map while deserializing, but got a class java.lang.Long" while i use firebase database.
I looked up some question the same problem on stackoverflow but didn't found a relevant solution.</p>

<p>This is my POJO class for storing the data from firebase.</p>

<pre><code>public class News {
public String topic;
public String detail;
public String user;
public Map&lt;String, String&gt; timestamp = null;

public News(){

}

public News(String topic, String detail, String user, HashMap&lt;String, String&gt; timeStamp){
    this.topic = topic;
    this.detail = detail;
    this.user = user;
    this.timestamp = timeStamp;
    //this.timestamp.put("timestamp", timeStamp);
    //this.timestamp.put("timestamp", ServerValue.TIMESTAMP);
}

public String getTopic(){
    return topic;
}

public String getDetail(){
    return detail;
}

@Exclude
public Map&lt;String, Object&gt; toMap() {
    HashMap&lt;String, Object&gt; result = new HashMap&lt;&gt;();

    result.put("topic", topic);
    result.put("detail", detail);
    result.put("user", user);
    result.put("timestamp", timestamp);

    return  result;
}
}
</code></pre>

<p>And this the main class where I get data from the the firebase.</p>

<pre><code>public class News_M extends AppCompatActivity {

FirebaseListAdapter mAdapter;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_news);

    ListView messagesView = (ListView) findViewById(R.id.listview);

    DatabaseReference ref = FirebaseDatabase.getInstance().getReference().child("abc").child("news");
    //News msg = new News("Holiday", "28 October", "fayeed", ServerValue.TIMESTAMP);
    //ref.push().setValue(msg);

    mAdapter = new FirebaseListAdapter&lt;News&gt;(this, News.class, android.R.layout.two_line_list_item, ref) {
        @Override
        protected void populateView(View view, News newsMessage, int position) {
            ((TextView)view.findViewById(android.R.id.text1)).setText(newsMessage.getTopic());
                 ((TextView)view.findViewById(android.R.id.text2)).setText(newsMessage.getDetail(      ));
        }
    };

    messagesView.setAdapter(mAdapter);
}

@Override
protected void onDestroy() {
    super.onDestroy();
    mAdapter.cleanup();
}
}
</code></pre>