Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MainActivity Not receiving callbacks of Items Tapped #14

Closed
bxute opened this issue Aug 14, 2016 · 1 comment
Closed

MainActivity Not receiving callbacks of Items Tapped #14

bxute opened this issue Aug 14, 2016 · 1 comment
Labels

Comments

@bxute
Copy link
Member

bxute commented Aug 14, 2016

Although event Listeners are subscribed , no callbacks are received

Listeners are as declared

private void subscribeToTaskAddListener(){
        SearchResultListAdapter.getInstance(this).setOnTaskAddListener(new TaskAddListener() {
            @Override
            public void onTaskTapped() {
                log("callback: task tapped");
                progressDialog = new ProgressDialog(MainActivity.this);
                progressDialog.setMessage("Requesting Your Stuff..");
                progressDialog.setCancelable(false);
                progressDialog.show();
            }

            @Override
            public void onTaskAddedToQueue(String task_info) {
                log("callback: task added to download queue");
                progressDialog.dismiss();
                makeToast(task_info + " Added To Download");
                //TODO: navigate to DownloadsActivity
            }
        });
    }

and set as

..
..
          setSearchView();
                pinFAB();
                subscribeToTaskAddListener();
        }
..

in

onCreate();

@bxute bxute added the bug label Aug 14, 2016
@bxute
Copy link
Member Author

bxute commented Aug 14, 2016

On force-call to call
we get

08-14 13:22:11.532  11102-11102/musicgenie.com.musicgenie E/AndroidRuntime﹕ FATAL EXCEPTION: main
    Process: musicgenie.com.musicgenie, PID: 11102
    java.lang.NullPointerException: Attempt to invoke interface method 'void musicgenie.com.musicgenie.interfaces.TaskAddListener.onTaskTapped()' on a null object reference
            at musicgenie.com.musicgenie.adapters.SearchResultListAdapter.addDownloadTask(SearchResultListAdapter.java:148)
            at musicgenie.com.musicgenie.adapters.SearchResultListAdapter.access$000(SearchResultListAdapter.java:42)
            at musicgenie.com.musicgenie.adapters.SearchResultListAdapter$1.onClick(SearchResultListAdapter.java:110)
            at android.view.View.performClick(View.java:4802)
            at android.view.View$PerformClick.run(View.java:20102)
            at android.os.Handler.handleCallback(Handler.java:810)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:189)
            at android.app.ActivityThread.main(ActivityThread.java:5529)
            at java.lang.reflect.Method.invoke(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:372)

@zeseeit zeseeit closed this as completed Nov 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants