How to add an Image to a ProgressDialog?
up vote
-1
down vote
favorite
I tried many ways to add an image to a Progress Dialog
Please Help me.
android progressdialog
add a comment |
up vote
-1
down vote
favorite
I tried many ways to add an image to a Progress Dialog
Please Help me.
android progressdialog
1
With inflate custom view.
– Piyush
Nov 19 at 12:13
go for this link, you will get help stackoverflow.com/questions/12115350/…
– Rishav Singla
Nov 19 at 12:25
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I tried many ways to add an image to a Progress Dialog
Please Help me.
android progressdialog
I tried many ways to add an image to a Progress Dialog
Please Help me.
android progressdialog
android progressdialog
edited Nov 19 at 12:20
Kling Klang
32.1k156287
32.1k156287
asked Nov 19 at 12:12
Chathura
1146
1146
1
With inflate custom view.
– Piyush
Nov 19 at 12:13
go for this link, you will get help stackoverflow.com/questions/12115350/…
– Rishav Singla
Nov 19 at 12:25
add a comment |
1
With inflate custom view.
– Piyush
Nov 19 at 12:13
go for this link, you will get help stackoverflow.com/questions/12115350/…
– Rishav Singla
Nov 19 at 12:25
1
1
With inflate custom view.
– Piyush
Nov 19 at 12:13
With inflate custom view.
– Piyush
Nov 19 at 12:13
go for this link, you will get help stackoverflow.com/questions/12115350/…
– Rishav Singla
Nov 19 at 12:25
go for this link, you will get help stackoverflow.com/questions/12115350/…
– Rishav Singla
Nov 19 at 12:25
add a comment |
2 Answers
2
active
oldest
votes
up vote
1
down vote
accepted
Try This Code
Dialog dialog = new Dialog(MainActivity.this);
dialog.setContentView(R.layout.custom_dialog_lay);
//dialog.setTitle("Progress");
TextView text = (TextView) dialog.findViewById(R.id.text);
text.setText("Loading... ");
ImageView image = (ImageView) dialog.findViewById(R.id.image);
image.setImageResource(R.drawable.android);
custom_dialog_lay.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_root"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="10dp"
>
<ImageView android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginRight="10dp"
/>
<TextView android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textColor="#FFF"
/>
<ImageView android:id="@+id/img"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="@drawable/sms_ic"
/>
Yes..!! it's Worked for me..!! but Could you please tell me how to remove title of the dialog..?
– Chathura
Nov 19 at 12:51
1
@Chathura remove or comment this Linedialog.setTitle("Progress");
– Sniffer
Nov 19 at 12:52
when comment this line Title not showing but it's space still there..!! how to remove it..!
– Chathura
2 days ago
How to include animating Gif image instead of this png..!!
– Chathura
2 days ago
@Chathura you can try Picasso or Glide library Check this answer
– Sniffer
2 days ago
add a comment |
up vote
1
down vote
Insert a layout which will hold the progressbar, text and imageview inside your layout like it is done below:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.v7.widget.RecyclerView
android:id="@+id/recipe_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.example.android.bakingapp.MainActivity"/>
<LinearLayout
android:id="@+id/dialog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_gravity="center"
android:orientation="horizontal">
<ProgressBar
android:id="@+id/progress_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_gravity="center"
android:textColor="@color/colorAccent"
android:layout_margin="20dp"
android:textSize="30sp"/>
<TextView
android:id="@+id/loading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_gravity="center"
android:textColor="@color/colorAccent"
android:text="Loading..."
android:textSize="20sp"
android:layout_margin="20dp"/>
<ImageView.../>
</LinearLayout>
</FrameLayout>
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Try This Code
Dialog dialog = new Dialog(MainActivity.this);
dialog.setContentView(R.layout.custom_dialog_lay);
//dialog.setTitle("Progress");
TextView text = (TextView) dialog.findViewById(R.id.text);
text.setText("Loading... ");
ImageView image = (ImageView) dialog.findViewById(R.id.image);
image.setImageResource(R.drawable.android);
custom_dialog_lay.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_root"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="10dp"
>
<ImageView android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginRight="10dp"
/>
<TextView android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textColor="#FFF"
/>
<ImageView android:id="@+id/img"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="@drawable/sms_ic"
/>
Yes..!! it's Worked for me..!! but Could you please tell me how to remove title of the dialog..?
– Chathura
Nov 19 at 12:51
1
@Chathura remove or comment this Linedialog.setTitle("Progress");
– Sniffer
Nov 19 at 12:52
when comment this line Title not showing but it's space still there..!! how to remove it..!
– Chathura
2 days ago
How to include animating Gif image instead of this png..!!
– Chathura
2 days ago
@Chathura you can try Picasso or Glide library Check this answer
– Sniffer
2 days ago
add a comment |
up vote
1
down vote
accepted
Try This Code
Dialog dialog = new Dialog(MainActivity.this);
dialog.setContentView(R.layout.custom_dialog_lay);
//dialog.setTitle("Progress");
TextView text = (TextView) dialog.findViewById(R.id.text);
text.setText("Loading... ");
ImageView image = (ImageView) dialog.findViewById(R.id.image);
image.setImageResource(R.drawable.android);
custom_dialog_lay.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_root"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="10dp"
>
<ImageView android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginRight="10dp"
/>
<TextView android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textColor="#FFF"
/>
<ImageView android:id="@+id/img"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="@drawable/sms_ic"
/>
Yes..!! it's Worked for me..!! but Could you please tell me how to remove title of the dialog..?
– Chathura
Nov 19 at 12:51
1
@Chathura remove or comment this Linedialog.setTitle("Progress");
– Sniffer
Nov 19 at 12:52
when comment this line Title not showing but it's space still there..!! how to remove it..!
– Chathura
2 days ago
How to include animating Gif image instead of this png..!!
– Chathura
2 days ago
@Chathura you can try Picasso or Glide library Check this answer
– Sniffer
2 days ago
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Try This Code
Dialog dialog = new Dialog(MainActivity.this);
dialog.setContentView(R.layout.custom_dialog_lay);
//dialog.setTitle("Progress");
TextView text = (TextView) dialog.findViewById(R.id.text);
text.setText("Loading... ");
ImageView image = (ImageView) dialog.findViewById(R.id.image);
image.setImageResource(R.drawable.android);
custom_dialog_lay.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_root"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="10dp"
>
<ImageView android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginRight="10dp"
/>
<TextView android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textColor="#FFF"
/>
<ImageView android:id="@+id/img"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="@drawable/sms_ic"
/>
Try This Code
Dialog dialog = new Dialog(MainActivity.this);
dialog.setContentView(R.layout.custom_dialog_lay);
//dialog.setTitle("Progress");
TextView text = (TextView) dialog.findViewById(R.id.text);
text.setText("Loading... ");
ImageView image = (ImageView) dialog.findViewById(R.id.image);
image.setImageResource(R.drawable.android);
custom_dialog_lay.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_root"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="10dp"
>
<ImageView android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginRight="10dp"
/>
<TextView android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textColor="#FFF"
/>
<ImageView android:id="@+id/img"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="@drawable/sms_ic"
/>
edited Nov 19 at 12:57
answered Nov 19 at 12:21
Sniffer
6331721
6331721
Yes..!! it's Worked for me..!! but Could you please tell me how to remove title of the dialog..?
– Chathura
Nov 19 at 12:51
1
@Chathura remove or comment this Linedialog.setTitle("Progress");
– Sniffer
Nov 19 at 12:52
when comment this line Title not showing but it's space still there..!! how to remove it..!
– Chathura
2 days ago
How to include animating Gif image instead of this png..!!
– Chathura
2 days ago
@Chathura you can try Picasso or Glide library Check this answer
– Sniffer
2 days ago
add a comment |
Yes..!! it's Worked for me..!! but Could you please tell me how to remove title of the dialog..?
– Chathura
Nov 19 at 12:51
1
@Chathura remove or comment this Linedialog.setTitle("Progress");
– Sniffer
Nov 19 at 12:52
when comment this line Title not showing but it's space still there..!! how to remove it..!
– Chathura
2 days ago
How to include animating Gif image instead of this png..!!
– Chathura
2 days ago
@Chathura you can try Picasso or Glide library Check this answer
– Sniffer
2 days ago
Yes..!! it's Worked for me..!! but Could you please tell me how to remove title of the dialog..?
– Chathura
Nov 19 at 12:51
Yes..!! it's Worked for me..!! but Could you please tell me how to remove title of the dialog..?
– Chathura
Nov 19 at 12:51
1
1
@Chathura remove or comment this Line
dialog.setTitle("Progress");
– Sniffer
Nov 19 at 12:52
@Chathura remove or comment this Line
dialog.setTitle("Progress");
– Sniffer
Nov 19 at 12:52
when comment this line Title not showing but it's space still there..!! how to remove it..!
– Chathura
2 days ago
when comment this line Title not showing but it's space still there..!! how to remove it..!
– Chathura
2 days ago
How to include animating Gif image instead of this png..!!
– Chathura
2 days ago
How to include animating Gif image instead of this png..!!
– Chathura
2 days ago
@Chathura you can try Picasso or Glide library Check this answer
– Sniffer
2 days ago
@Chathura you can try Picasso or Glide library Check this answer
– Sniffer
2 days ago
add a comment |
up vote
1
down vote
Insert a layout which will hold the progressbar, text and imageview inside your layout like it is done below:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.v7.widget.RecyclerView
android:id="@+id/recipe_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.example.android.bakingapp.MainActivity"/>
<LinearLayout
android:id="@+id/dialog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_gravity="center"
android:orientation="horizontal">
<ProgressBar
android:id="@+id/progress_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_gravity="center"
android:textColor="@color/colorAccent"
android:layout_margin="20dp"
android:textSize="30sp"/>
<TextView
android:id="@+id/loading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_gravity="center"
android:textColor="@color/colorAccent"
android:text="Loading..."
android:textSize="20sp"
android:layout_margin="20dp"/>
<ImageView.../>
</LinearLayout>
</FrameLayout>
add a comment |
up vote
1
down vote
Insert a layout which will hold the progressbar, text and imageview inside your layout like it is done below:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.v7.widget.RecyclerView
android:id="@+id/recipe_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.example.android.bakingapp.MainActivity"/>
<LinearLayout
android:id="@+id/dialog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_gravity="center"
android:orientation="horizontal">
<ProgressBar
android:id="@+id/progress_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_gravity="center"
android:textColor="@color/colorAccent"
android:layout_margin="20dp"
android:textSize="30sp"/>
<TextView
android:id="@+id/loading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_gravity="center"
android:textColor="@color/colorAccent"
android:text="Loading..."
android:textSize="20sp"
android:layout_margin="20dp"/>
<ImageView.../>
</LinearLayout>
</FrameLayout>
add a comment |
up vote
1
down vote
up vote
1
down vote
Insert a layout which will hold the progressbar, text and imageview inside your layout like it is done below:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.v7.widget.RecyclerView
android:id="@+id/recipe_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.example.android.bakingapp.MainActivity"/>
<LinearLayout
android:id="@+id/dialog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_gravity="center"
android:orientation="horizontal">
<ProgressBar
android:id="@+id/progress_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_gravity="center"
android:textColor="@color/colorAccent"
android:layout_margin="20dp"
android:textSize="30sp"/>
<TextView
android:id="@+id/loading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_gravity="center"
android:textColor="@color/colorAccent"
android:text="Loading..."
android:textSize="20sp"
android:layout_margin="20dp"/>
<ImageView.../>
</LinearLayout>
</FrameLayout>
Insert a layout which will hold the progressbar, text and imageview inside your layout like it is done below:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.v7.widget.RecyclerView
android:id="@+id/recipe_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.example.android.bakingapp.MainActivity"/>
<LinearLayout
android:id="@+id/dialog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_gravity="center"
android:orientation="horizontal">
<ProgressBar
android:id="@+id/progress_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_gravity="center"
android:textColor="@color/colorAccent"
android:layout_margin="20dp"
android:textSize="30sp"/>
<TextView
android:id="@+id/loading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_gravity="center"
android:textColor="@color/colorAccent"
android:text="Loading..."
android:textSize="20sp"
android:layout_margin="20dp"/>
<ImageView.../>
</LinearLayout>
</FrameLayout>
answered Nov 19 at 12:24
Show Young Soyinka
34119
34119
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53374401%2fhow-to-add-an-image-to-a-progressdialog%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
With inflate custom view.
– Piyush
Nov 19 at 12:13
go for this link, you will get help stackoverflow.com/questions/12115350/…
– Rishav Singla
Nov 19 at 12:25