티스토리 뷰
res > layout > progress.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:padding="13dp"
android:layout_centerHorizontal="true"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ProgressBar
android:id="@+id/loader"
android:layout_marginEnd="5dp"
android:layout_width="45dp"
android:layout_height="45dp" />
<TextView
android:layout_width="wrap_content"
android:text="Connecting..."
android:textAppearance="?android:textAppearanceSmall"
android:layout_gravity="center_vertical"
android:id="@+id/loading_msg"
android:layout_toEndOf="@+id/loader"
android:layout_height="wrap_content" />
</LinearLayout>
MainActivity.java
Dialog progressdialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setView(R.layout.progress);
// This should be called once in your Fragment's onViewCreated() or in Activity onCreate() method to avoid dialog duplicates.
progressdialog = builder.create();
}
// This method is used to control the progress dialog.
public void setDialog(boolean show){
if (show)progressdialog.show();
else progressdialog.dismiss();
}
반응형
'개발 > Android' 카테고리의 다른 글
| Window Status Bar & Action Bar 컬러 변경 (0) | 2021.12.02 |
|---|
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- USB Mass Storage
- whose view is not in the window hierarchy
- 롯데캐슬
- raspberrypi serial
- usbipd attach
- Android Bar Color
- SHORT URL
- Window Status Bar
- sms
- Naver Cloud Platform
- 루미니
- 다트 플러터
- wsl usb mount
- setTimeout
- clearTimeout
- action bar
- AlertDialog
- ProgressBar
- sms api
- Shell Script
- wsl lsblk
- artik710
- Nginx #NodeJS #웹서버 #포트포워딩 #웹호스팅 #백엔드개발 #웹개발 #웹프로젝트 #서버관리 #웹애플리케이션
- viewDidLoad()
- Bad mode in Synchronous Abort handler detected
- 어바니엘
- Dart Flutter
- viewDidAppear()
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
글 보관함