Skip to main content

Posts

Crash on Android P - Didn't find class "org.apache.http.ProtocolVersion" #949

use this If your app is targeting API level 28 (Android 9.0) or above, you must include the following declaration within the  <application>  element of AndroidManifest.xml. <uses-library android:name="org.apache.http.legacy" android:required="false" /> If your app is targeting a lower API level, this is handled for you. Curiously this doesn't happen on the master branch yet, so it must be a side effect of newer Maps API version in the nav branch, or a combination with other Firebase or Play Services features there. The error message "Didn't find class "org.apache.http.ProtocolVersion"" is related to the use of the Apache HTTP library, which is no longer supported in Android P (API level 28) and higher. The class org.apache.http.ProtocolVersion is a part of this library. To fix this issue, you will need to remove the dependency on the Apache HTTP library and replace it with a more recent library that is sup...

How to create google map with drag marker to get user location with auto correct location edit text ...

For drag and drop with user location You have to create a google map fragment activity below are the xml code of google map xml <? xml version ="1.0" encoding ="utf-8" ?> < androidx.constraintlayout.widget.ConstraintLayout 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 :layout_width ="match_parent" android :layout_height ="match_parent" tools :context =".GetUserLocationActivity" > < fragment android :id ="@+id/mapuserloc" android :name ="com.google.android.gms.maps.SupportMapFragment" android :layout_width ="match_parent" android :layout_height ="522dp" app :layout_constraintEnd_toEndOf ="parent" app :layout_constraintStart_toStartOf ="p...

How to implement the Android ActionBar back button

Add this code in your on create activity Method  @Override protected void onCreate(Bundle savedInstanceState) { super .onCreate(savedInstanceState); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled( true ); getSupportActionBar().setDisplayShowHomeEnabled( true ); } then call this method @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id. home : finish(); return true ; default : return super .onOptionsItemSelected(item); } } this is default support action bar if you want your own then use own tool bar in your xml thanks

Saved Perf in Android

Just add this class in your package  package com.plzf1.rollearn ; import android.app.Application ; import android.content.SharedPreferences ; public class MyApplication extends Application { public static final String MENULIST = "menulist" ; public static final String VEGLIST = "veglist" ; public static final String CARTLIST = "cartlist" ; public static final String FRUITLIST = "fruitlist" ; @Override public void onCreate () { super .onCreate() ; } public void saveIntoPrefs (String key , String value) { SharedPreferences prefs = getSharedPreferences(Fconstants.PREF_NAME , MODE_PRIVATE ) ; SharedPreferences.Editor edit = prefs.edit() ; edit.putString(key , value) ; edit.commit() ; } public void saveIntoPrefs (String key , int value) { SharedPreferences prefs = getSharedPreferences(Fconstants.PREF_NAME , MODE_PRIVATE ) ; SharedPreferences.Edit...