Category : java

I create a ViewModel in my MainActivity.java: AnchorViewModel anchorViewModel = new ViewModelProvider(this).get(AnchorViewModel.class); anchorViewModel.getAllAnchors() .observe(this, updateArObjectsOnChangeInSceneHelper::updateAnchorsInArScene); Then, I pass the anchorViewModel to another class. Now I want to call anchorViewModel.insert() and anchorViewModel.update() from that class instead of MainActivity.java. I try that but it doesn’t trigger the updateAnchorsInArScene function. In fact, I can only trigger it when ..

Read more

I keep getting this error despite adding android:exported attribute in my manifest file. No matter what I do, the code won’t execute. I am trying to make a video conferencing app using firebase and jitsi SDK. I have correctly examined all possibilities of what caused this error, but I came empty-handed. Error Manifest merger failed ..

Read more

Here i want to plot a graph from fetching data from Firebase but for a reason my code doesnt add entries in the for loop. Here is my code below: public void firebaseFunction() { if (deviceId != null) { myRef.child("soguk_hava_depolari").child(deviceId).addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot snapshot) { for (DataSnapshot dataSnapshot : snapshot.getChildren()) { ..

Read more

According to the Documentation, the below code can set a timestamp as the key of the node using push() in the real time DB . public void uploadToDB(String s) { databaseReference.child("uid2").child("recommend").child("dish").push().setValue(s); } The returned key are as below of my push(), as example: a) -MpfCu14jtIkEk28D3CB b) -MpfCxv_Nzv3YJ87MfZH My question is: are they timestamp? if yes, ..

Read more

Currently, I have an Activity, which is used to configure home widget. It is shown during When user place the home widget on desktop for the 1st time. Or, when user tapped on the already shown home widget. This is the Manifest for the Activity. <activity android:name="com.xxx.widget.NoteListAppWidgetConfigureFragmentActivity" android:taskAffinity="com.xxx.launcher" android:windowSoftInputMode="stateAlwaysHidden" > <intent-filter> <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE"/> </intent-filter> </activity> ..

Read more

I’m getting from Room’s query Flow<List<ByteArray>>, which need to be converted to InputStream class FlowListInputStream( private val scope: CoroutineScope, private val flow: Flow<List<ByteArray>> //size of list could be up-to several thousands ): InputStream() { override fun read(): Int { //todo… } } Context: In my SQLite I’m storing in BLOBs number of video/audio/image binaries with ..

Read more