-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFragment.java
48 lines (41 loc) · 1.88 KB
/
Fragment.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package com.anuhas.quity;
import androidx.appcompat.app.AppCompatActivity;
import androidx.cardview.widget.CardView;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import com.anuhas.danumgula.Class.Grade10;
import com.anuhas.danumgula.Class.Grade11;
import com.anuhas.danumgula.Class.Grade9;
import com.anuhas.danumgula.R;
import com.anuhas.danumgula.Class.AL_Activity;
import com.anuhas.danumgula.Class.OL_activity;
import com.anuhas.danumgula.Class.School_ship;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
public class Fragment extends Fragment {
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment, container, false);
return view;
}
private void launchAlertDialog() {
new MaterialAlertDialogBuilder(getcontext(), R.style.MaterialAlertDialog_Rounded)
.setTitle("Quity update required")
.setMessage("Quity recommends that you to update to latest version")
.setPositiveButton("Update", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int i) {
try {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=com.anuhas.quity")));
}catch (Exception e){
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=com.anuhas.quity")));
}
}
})
.setCancelable(false)
.show();
}
}