Skip to content
Advertisement

Tag: android

Difference between addChildEventListener, addValueEventListener, and addOnCompleteListener when using orderByChild()?

I’m trying to sort and display data from Firebase using orderByChild() and used: I kept on wondering why it’s not sorting until I realized that childEventListener was used in the documentation. It should’ve been: What is the difference between the two and addValueEventListener when it comes to using orderByChild or any sorting method? Does get() not follow orderByChild()? Answer All

Action bar content is not hiding

so i want to use toolbar but when i change DarkActionBar to NoActionBar in the styles,action bar doesnt remove completely and app title is on my toolbar. https://i.stack.imgur.com/0X722.jpg here is my xml code: what can i do? Answer i think you have in MainActivity code like this and you got the result as shown in the screenshot just remove this

The code is constantly crashing (android studio, java language)

Errors: E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.myapplication, PID: 8501 android.content.res.Resources$NotFoundException: Resource ID #0x7f070058 at android.content.res.Resources.getValue(Resources.java:1266) at androidx.appcompat.widget.ResourceManagerInternal.loadDrawableFromDelegates(ResourceManagerInternal.java:255) at androidx.appcompat.widget.ResourceManagerInternal.getDrawable(ResourceManagerInternal.java:142) at androidx.appcompat.widget.ResourceManagerInternal.getDrawable(ResourceManagerInternal.java:135) at androidx.appcompat.content.res.AppCompatResources.getDrawable(AppCompatResources.java:104) at androidx.appcompat.view.menu.MenuItemImpl.getIcon(MenuItemImpl.java:505) at androidx.appcompat.view.menu.ListMenuItemView.initialize(ListMenuItemView.java:131) at androidx.appcompat.view.menu.MenuAdapter.getView(MenuAdapter.java:109) at androidx.appcompat.view.menu.MenuPopup.measureIndividualMenuWidth(MenuPopup.java:161) at androidx.appcompat.view.menu.StandardMenuPopup.tryShow(StandardMenuPopup.java:174) at androidx.appcompat.view.menu.StandardMenuPopup.show(StandardMenuPopup.java:208) at androidx.appcompat.view.menu.MenuPopupHelper.showPopup(MenuPopupHelper.java:296) at androidx.appcompat.view.menu.MenuPopupHelper.tryShow(MenuPopupHelper.java:182) at androidx.appcompat.widget.ActionMenuPresenter$OpenOverflowRunnable.run(ActionMenuPresenter.java:792) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5254) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) FirstScreenActivity: SecondScreenActivity:

How to get method name in android (java)

I want to retrieve the method name on an android app for logging purposes but can’t seem to get it. I’ve already tried doing what was suggested in other answers, such as: Thread.currentThread().getStackTrace(); and new Object(){}.getClass().getEnclosingMethod().getName(); To no avail, the first returns me a stack with something like: The second returns “a” as the method name. Does anyone know another

Launching a transparent activity on HomeScreen

So there is an activity containing a webview. On launch/click on App Icon it should launch activity with webview as dialog on the HomeScreen of the device. Is there a way to achieve this? Answer Yes, you can do it. Set the theme of MainActivity to Dialog, then you’ll achieve it. It works fine for me. Hope it can help

Out of order BufferInfo.presentationTimeUs timestamps in mediacodec decoder

I am getting irregular newBufferInfo.presentationTimeUs because of which if I put Thread.sleep to slow down the playback, a lot of frames are dropped. Actually, with Surface the frames timestamps are synchronized automatically with system timestamp without sleep, however it does not work with giving output to OpenGLES. https://developer.android.com/reference/android/media/MediaCodec#releaseOutputBuffer(int,%20long) I thought mExtractor.getSampleTime() is the problem but even after removing it, the

Advertisement