I am learnign how to handle and to use functional programming in Android. So I developed the below code. I would like to handle the HandlerThread as observable, but when I try to call .start() from .map() operator I receive the following error:
no instances of type variable(s) R exists so that void conforms to R
please let me know why I am getting this error and how to solve it.
code:
public Single<HandlerThread> getObsInitializedHandlerThread() {
this.mMyHandlerThread = new MyHandlerThread(NAME_MY_HANDLER_THREAD);
return Single.just(this.mMyHandlerThread);
}
@Override
protected void onResume() {
super.onResume();
String TAG_LOG = ActMain.TAG_LOG + "." + "onResume()";
Log.v(TAG_LOG, ":");
this.getObsInitializedHandlerThread()
.map(mMyHandlerThread -> mMyHandlerThread.start());
}
private class MyHandlerThread extends HandlerThread {
public MyHandlerThread(String name) {
super(name);
String TAG_LOG = ActMain.class.getSimpleName() + "." + "MyHandlerThread() Constructor";
Log.v(TAG_LOG, ":");
}
@Override
protected void onLooperPrepared() {
super.onLooperPrepared();
String TAG_LOG = ActMain.class.getSimpleName() + "." + onLoopPrepared()";
Log.v(TAG_LOG, ":");
}
}
In map you allways need to return a value (T) you cant return a void so can you trye
this.getObsInitializedHandlerThread()
.map(mMyHandlerThread ->{
mMyHandlerThread.start();
return mMyHandlerThread;
});
Firebase Cloud Functions: PubSub, "res.on is not a function"
TypeError: Cannot read properties of undefined (reading 'createMessageComponentCollector')
I have API 21 android mobile and I want to run android app on my own mobile but I know that I did so many mistakes in build gradle fileI just want to know in where to change in gradle file and wht to change so that I can run app on api 21 android? I also want to put code or my gradle...
While building the app I get the error:
I have ionic3 project let's say with id="comname-mobile