-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMainActivity.java
More file actions
37 lines (33 loc) · 829 Bytes
/
Copy pathMainActivity.java
File metadata and controls
37 lines (33 loc) · 829 Bytes
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
package com.example.circleprogressbar;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
public class MainActivity extends ActionBarActivity {
CircleImageProgressBar progressBar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
progressBar=(CircleImageProgressBar)findViewById(R.id.circleProgressbar);
progressBar.setMaxProgress(1000);
new Thread()
{
public void run()
{
int i=0;
while(i<=1000)
{
i++;
progressBar.setProgressNotInUiThread(i);
try {
sleep(10);
} catch (InterruptedException e) {
// TODO ×Ô¶¯Éú³ÉµÄ catch ¿é
e.printStackTrace();
}
}
}
}.start();
}
}