Category : java

I wanted to extract the retrofit request implementation from activity. So I thought of creating a class which makes all the requests and send the result through an interface to the activity. I created an interface for the response callback as below public interface IApi { void onSuceessTodo(Todo todo); void onSuceessPosts(List<Post> postList); void onFailure(String errorMessage); ..

Read more

My app shut when a launch it. It’s supposed to be a simple app with tag navigation E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.tabexperiment, PID: 20310 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.tabexperiment/com.example.tabexperiment.MainActivity}: java.lang.IllegalStateException: This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_SUPPORT_ACTION_BAR and set windowActionBar to false in your ..

Read more

I am using phone number authentication using firebase. and I am facing issue in Instant verification: in some cases the phone number can be instantly verified without needing to send or enter a verification code. How to disable or stop this process. Because I can use phone number verification with send message with code and ..

Read more

I have a SearchableSpinner and I want to display the text in the center of it <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <com.toptoche.searchablespinnerlibrary.SearchableSpinner android:id="@+id/spinner_client" style="@style/spinner_style_v2" android:layout_width="300dp" android:layout_height="wrap_content" android:padding="5dp" android:drawSelectorOnTop="true"/> </LinearLayout> and here the custom style. I tried adding <item name="android:textAlignment">center</item> but it’s not working also I’ve tried <item name="android:paddingTop">10dp</item> to see if the text will move to ..

Read more

I want to add firebase to my project, this is my dependencies: implementation fileTree(dir: ‘libs’, include: [‘*.jar’]) implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation ‘androidx.appcompat:appcompat:1.2.0’ implementation ‘androidx.core:core-ktx:1.3.2’ implementation ‘androidx.constraintlayout:constraintlayout:2.0.4’ implementation ‘androidx.legacy:legacy-support-v4:1.0.0’ implementation ‘com.google.android.material:material:1.3.0’ implementation ‘de.hdodenhof:circleimageview:3.1.0’ implementation ‘androidx.vectordrawable:vectordrawable:1.1.0’ implementation ‘androidx.navigation:navigation-fragment:2.3.3’ implementation ‘androidx.navigation:navigation-ui:2.3.3’ implementation ‘androidx.lifecycle:lifecycle-extensions:2.2.0’ testImplementation ‘junit:junit:4.13’ androidTestImplementation ‘androidx.test.ext:junit:1.1.2’ androidTestImplementation ‘androidx.test.espresso:espresso-core:3.3.0’ implementation ‘com.google.android.gms:play-services-maps:17.0.0’ implementation ‘androidx.navigation:navigation-fragment-ktx:2.3.3’ implementation ‘androidx.navigation:navigation-ui-ktx:2.3.3’ implementation ‘com.android.support:multidex:1.0.3’ implementation ‘io.reactivex.rxjava2:rxjava:2.2.11’ ..

Read more

I want to send 2MB wave file via android device and esp8266 real time.And esp8266 is connected to STM32F030 . I used wifi bridge library from this site. I changed BaudRate to 2.4M bit per second . Because Flash and RAM of STM32 is low , I have to send data as 512 byte from ..

Read more

Hi have been using fragments and have a drawer header which is going to display the currently logged in user. activity_main.xml <?xml version="1.0" encoding="utf-8"?> <androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_centerHorizontal="false" android:background="?android:attr/colorBackground" tools:context=".MainActivity"> <include layout="@layout/drawer_toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" /> <include layout="@layout/content_main" android:layout_width="match_parent" android:layout_height="wrap_content" /> <com.google.android.material.navigation.NavigationView android:id="@+id/navigationView" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="start" android:fitsSystemWindows="true" app:headerLayout="@layout/drawer_header" app:menu="@menu/drawer_menu" /> </androidx.drawerlayout.widget.DrawerLayout> This ..

Read more