Java Code Examples for android.app.ProgressDialog#hide()
The following examples show how to use
android.app.ProgressDialog#hide() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DetailPrıductFragment.java From RestaurantApp with GNU General Public License v3.0 | 5 votes |
@Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { view = inflater.inflate(R.layout.fragment_detail_product, container, false); android_id = Settings.Secure.getString(getActivity().getContentResolver(), Settings.Secure.ANDROID_ID); FirebaseApp.initializeApp(getActivity()); firebaseDatabase = FirebaseDatabase.getInstance(); databaseReference = firebaseDatabase.getReference("basket").child(android_id); btnAddBasket = (FlatButton) view.findViewById(R.id.btnAddBasket); btnAddBasket.setOnClickListener(this); progressDialog = new ProgressDialog(getActivity()); progressDialog.setMessage("Ürün Yükleniyor.."); progressDialog.show(); progressDialog.hide(); //OnSuucese kaydet sliderLayout = (SliderLayout) view.findViewById(R.id.slider); tvPrice = (TextView) view.findViewById(R.id.tvPrice); etPiece = (EditText) view.findViewById(R.id.etPiece); etPiece.addTextChangedListener(this); imageList = new ArrayList<>(); productIdExstra = getArguments().getInt("id"); urlDetail+=productIdExstra; Request request = new Request(getActivity(), urlDetail, com.android.volley.Request.Method.GET); request.requestVolley(this); return view; }
Example 2
Source File: BasketFragment.java From RestaurantApp with GNU General Public License v3.0 | 5 votes |
@Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { view = inflater.inflate(R.layout.fragment_basket, container, false); android_id = Settings.Secure.getString(getActivity().getContentResolver(), Settings.Secure.ANDROID_ID); Request requestTemp = new Request(getActivity(), urlTempDesk, com.android.volley.Request.Method.POST); requestTemp.requestVolleyTempDesk(this, deskID); progressDialog = new ProgressDialog(getActivity()); progressDialog.setMessage("Sepet Yükleniyor.."); progressDialog.show(); progressDialog.hide(); tvBasketNull = (TextView) view.findViewById(R.id.tvBasketNull); lvBasket = (ListView) view.findViewById(R.id.lvBasket); btnOrder = (FlatButton) view.findViewById(R.id.btnOrder); btnOrder.setOnClickListener(this); SharedPreferences sharedpreferences = getActivity().getSharedPreferences("userBasket", Context.MODE_PRIVATE); userFlag = sharedpreferences.getBoolean("user",false); if (userFlag){ btnOrder.setText("SİPARİŞ VER"); } productBaskets = new ArrayList<>(); firebaseDatabase = FirebaseDatabase.getInstance(); databaseReference = firebaseDatabase.getReference("basket").child(android_id); databaseReference.addValueEventListener(this); return view; }
Example 3
Source File: Util.java From NetworkGhost with GNU General Public License v2.0 | 4 votes |
public static void uninstall(Context ctx) { // show loading menu ProgressDialog dialog = ProgressDialog.show(ctx, "Uninstalling", "Remounting system...", true); dialog.show(); // remount system final String[] result = {""}; Command command = new Command(0, "mount -o rw,remount /system") { @Override public void output(int id, String line) { } }; runCmd(command); // check if success command = new Command(0, "mount|grep system") { @Override public void output(int id, String line) { if(line.contains("rw")) result[0] = "yes"; } }; runCmd(command); if(!result[0].equals("yes")) { dialog.hide(); new AlertDialog.Builder(ctx).setTitle("Error").setMessage("Error remounting system. Sorry! Nothing was touched.").setPositiveButton("OK", null).create().show(); return; } result[0] = ""; dialog.setMessage("Moving wpa_supplicant back"); // move wpa_supplicant command = new Command(0, "mv /system/bin/wpa_supplicant_real /system/bin/wpa_supplicant") { @Override public void output(int id, String line) { } }; runCmd(command); // check if success command = new Command(0, "ls /system/bin/wpa_*") { @Override public void output(int id, String line) { if(line.contains("_real")) result[0] = "yes"; } }; runCmd(command); if(result[0].equals("yes")) { dialog.hide(); new AlertDialog.Builder(ctx).setTitle("Error").setMessage("Error moving wpa_supplicant back. Sorry! Failed.").setPositiveButton("OK", null).create().show(); return; } result[0] = ""; dialog.hide(); new AlertDialog.Builder(ctx).setTitle("Success").setMessage("Uninstalled code successfully").setPositiveButton("OK", null).create().show(); }
Example 4
Source File: Util.java From NetworkGhost with GNU General Public License v2.0 | 4 votes |
public static void performInstall(Context ctx) { // show loading menu ProgressDialog dialog = ProgressDialog.show(ctx, "Installing", "Remounting system...", true); dialog.show(); // remount system final String[] result = {""}; Command command = new Command(0, "mount -o rw,remount /system") { @Override public void output(int id, String line) { } }; runCmd(command); // check if success command = new Command(0, "mount|grep system") { @Override public void output(int id, String line) { if(line.contains("rw")) result[0] = "yes"; } }; runCmd(command); if(!result[0].equals("yes")) { dialog.hide(); new AlertDialog.Builder(ctx).setTitle("Error").setMessage("Error remounting system. Sorry! Nothing was touched.").setPositiveButton("OK", null).create().show(); return; } result[0] = ""; dialog.setMessage("Moving wpa_supplicant"); // move wpa_supplicant command = new Command(0, "mv /system/bin/wpa_supplicant /system/bin/wpa_supplicant_real") { @Override public void output(int id, String line) { } }; runCmd(command); // check if success command = new Command(0, "ls /system/bin/wpa_*") { @Override public void output(int id, String line) { if(line.contains("_real")) result[0] = "yes"; } }; runCmd(command); if(!result[0].equals("yes")) { dialog.hide(); new AlertDialog.Builder(ctx).setTitle("Error").setMessage("Error moving wpa_supplicant. Sorry! Nothing was touched.").setPositiveButton("OK", null).create().show(); return; } result[0] = ""; // inject our script dialog.setMessage("Injecting our mac changing code"); command = new Command(0, "echo '#!/system/xbin/bash|/system/xbin/busybox ifconfig wlan0 up hw ether $(cat /dev/mac)|/system/bin/wpa_supplicant_real $@' | sed 's/|/\\n/g' > /system/bin/wpa_supplicant", "busybox chmod +x /system/bin/wpa_supplicant") { @Override public void output(int id, String line) { } }; runCmd(command); // check if success if(isInstalled()) { dialog.hide(); new AlertDialog.Builder(ctx).setTitle("Success").setMessage("Installed code successfully").setPositiveButton("OK", null).create().show(); } else { //dialog.hide(); //new AlertDialog.Builder(ctx).setTitle("Error").setMessage("Error inserting our wpa_supplicant. Will try to revert now.").setPositiveButton("OK", null).create().show(); dialog.setMessage("Error inserting out wpa_supplicant. Trying to revert..."); command = new Command(0, "mv /system/bin/wpa_supplicant_real /system/bin/wpa_supplicant") { @Override public void output(int id, String line) { } }; runCmd(command); command = new Command(0, "ls /system/bin/wpa_*") { @Override public void output(int id, String line) { if(line.contains("_real")) result[0] = "yes"; } }; runCmd(command); if(result[0].equals("yes")) { new AlertDialog.Builder(ctx).setTitle("Error").setMessage("Error reverting wpa_supplicant! System in inconsistent state.").setPositiveButton("OK", null).create().show(); } else { new AlertDialog.Builder(ctx).setTitle("Error").setMessage("Reverted successfully.").setPositiveButton("OK", null).create().show(); } dialog.hide(); } }