android studio error while fetching nearby atm in android studio
- Android Development
- 0 Replies
it is not resolving i tried many ways ,but i couldnt fix this issue
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.

public class AndroidModel {
private String name;
private String title;
private Drawable icon;
Intent androidLaunch;
public AndroidModel(String name, String title, Drawable _icon, Intent _launch) {
this.name = name;
this.title= title;
this.icon = _icon;
this.androidLaunch = _launch;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public void setTitle(String title) {
this.title = title;
}
public String getTitle() {
return title;
}
public void setIcon(Drawable icon) {
this.icon = icon;
}
public Drawable getIcon() {return icon;}
public void setLaunch(Drawable icon) {
this.androidLaunch = androidLaunch;
}
public Intent getLaunch() {return androidLaunch;}
}
class AppInfo {
String appname = "";
String pname = "";
Drawable icon;
String Source = "";
Intent Launching;
}
AppInfo newInfo = new AppInfo();
newInfo.appname = activityInfo.applicationInfo.loadLabel(getContext().getPackageManager()).toString();
newInfo.pname = activityInfo.packageName;
newInfo.Source = activityInfo.applicationInfo.sourceDir;
newInfo.Launching = pm.getLaunchIntentForPackage(activityInfo.packageName);
newInfo.icon = activityInfo.applicationInfo.loadIcon(getContext().getPackageManager());
androidList.add(
new AndroidModel(newInfo.appname, newInfo.appname, newInfo.icon, newInfo.Launching)
);
@SuppressLint("UseCompatLoadingForDrawables")
@Override
public void onBindViewHolder(AndroidAdapter.MyViewHolder holder, int position) {
ImageView imageView = holder.mPhotoImageView;
if (!mAndroidList.get(position).getName().isEmpty()) {
Glide.with(mContext)
.asBitmap()
.load(mAndroidList.get(position).getIcon())
.diskCacheStrategy(DiskCacheStrategy.ALL)
.skipMemoryCache(true)
.priority(Priority.HIGH)
.signature(new ObjectKey(String.valueOf(System.currentTimeMillis())))
.apply(new RequestOptions().override(150, 150))
.into(imageView);
holder.mTitle.setText(mAndroidList.get(position).getName());
}
}


<?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"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.cardview.widget.CardView
android:layout_width="0dp"
android:layout_height="183dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
app:cardCornerRadius="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ProgressBar
android:id="@+id/progressLoading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/txtProgress" />
<TextView
android:id="@+id/txtProgress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="Test..."
android:textAlignment="center"
android:textColor="@color/black"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.495"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/txtProgressCount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:text="TextView"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.501"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/progressBarCount"
app:layout_constraintVertical_bias="1.0" />
<ProgressBar
android:id="@+id/progressBarCount"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.487"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/progressLoading" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</androidx.constraintlayout.widget.ConstraintLayout>
public class LoadingDialog{
Context context;
private Dialog dialog = null;
public LoadingDialog(Context context) {
this.context = context;
}
public void startLoadingDialog(String title) {
dialog = new Dialog(context);
dialog.setContentView(R.layout.custom_progressbar);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setCanceledOnTouchOutside(false);
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
TextView txtTitleCount = dialog.findViewById(R.id.txtProgressCount);
TextView txtTitle = dialog.findViewById(R.id.txtProgress);
ProgressBar barCount = dialog.findViewById(R.id.progressBarCount);
txtTitle.setText(title);
txtTitleCount.setVisibility(View.GONE);
barCount.setVisibility(View.GONE);
dialog.setCancelable(false);
dialog.create();
dialog.show();
}
public void dismissDialog() {
dialog.dismiss();
}
}
final LoadingDialog loadingDialog = new LoadingDialog(this);
ExecutorService service = Executors.newFixedThreadPool(10);
service.execute(() -> {
runOnUiThread(() -> loadingDialog.startLoadingDialog("prova"));
SystemClock.sleep(1000);
runOnUiThread(loadingDialog::dismissDialog);
});