Code Monkey home page Code Monkey logo

addme-android's Introduction

Creating connections, has never been easier!

addme-android's People

Contributors

ionpetro avatar mlazana avatar skpanagiotis avatar

Watchers

 avatar

addme-android's Issues

This should have been working....

This is the code:

private void createListAdapter(ArrayList<String> fullnames) {
final String[] finalfullnames = fullnames.toArray(new String[fullnames.size()]);
System.out.println("This is what I am looking for" + Arrays.toString(finalfullnames));
CustomContactList listAdapter = new
CustomContactList(Contacts.this, finalfullnames);
listView.setAdapter(listAdapter);
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
}
});

And this is the logcat:

2019-06-28 05:29:05.789 13933-13933/com.addme.addmeapp I/System.out: This is what I am looking for[Ion Petropoulos, Donna]
2019-06-28 05:29:05.790 13933-13933/com.addme.addmeapp D/AndroidRuntime: Shutting down VM
2019-06-28 05:29:05.791 13933-13933/com.addme.addmeapp E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.addme.addmeapp, PID: 13933
    java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ListView.setAdapter(android.widget.ListAdapter)' on a null object reference
        at com.addme.addmeapp.Contacts.createListAdapter(Contacts.java:136)
        at com.addme.addmeapp.Contacts.access$000(Contacts.java:33)
        at com.addme.addmeapp.Contacts$1$1.onDataChange(Contacts.java:69)
        at com.google.firebase.database.core.ValueEventRegistration.fireEvent(com.google.firebase:firebase-database@@16.0.6:75)
        at com.google.firebase.database.core.view.DataEvent.fire(com.google.firebase:firebase-database@@16.0.6:63)
        at com.google.firebase.database.core.view.EventRaiser$1.run(com.google.firebase:firebase-database@@16.0.6:55)
        at android.os.Handler.handleCallback(Handler.java:789)
        at android.os.Handler.dispatchMessage(Handler.java:98)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6944)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

As you can see, the finalfullnames inside the method has taken the values, but when I call the setAdapter method, i get a NullPointerException

If the answer is that firebase is async, then really I don't know how else I can approach this problem

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.