Write below code in oncreate method to set full screen mode:-
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
android:cacheColorHint Properties of listview :-
For Exm--
public class myActivity extends Activity { private Timer myTimer; /** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); myTimer = new Timer(); myTimer.schedule(new TimerTask() { @Override public void run() { TimerMethod(); } }, 0, 1000); } private void TimerMethod() { //This method is called directly by the timer //and runs in the same thread as the timer. //We call the method that will work with the UI //through the runOnUiThread method. this.runOnUiThread(Timer_Tick); } private Runnable Timer_Tick = new Runnable() { public void run() { //This method runs in the same thread as the UI. //Do something to the UI thread here } }; }
Matrix transform = new Matrix();
transform.setTranslate(xOfCentre, yOfCentre);
transform.preRotate(turnDegrees, width/2, height/2);
canvas.drawBitmap(bitmap, transform, null);
TextView xyz= (TextView)findViewById(R.id.xyz);
xyz.setText(Html.fromHtml(getString(R.string.nice_html)));
startActivity()
, passing it an Intent
that describes the activity you
want to start.Intent intent = new Intent(this, SignInActivity.class); startActivity(intent);
Activity
is an application component that provides a screen with which
users can interact in order to do something, such as dial the phone, take a photo, send an email, or
view a map. Each activity is given a window in which to draw its user interface.1 |
private ProgressDialog progressDialog; |
01 |
private void runDialog( final int seconds) |
02 |
{ |
03 |
progressDialog = ProgressDialog.show( this , "Please wait...." , "Here your message" ); |
04 |
05 |
new Thread( new Runnable(){ |
06 |
public void run(){ |
07 |
try { |
08 |
Thread.sleep(seconds * 1000 ); |
09 |
progressDialog.dismiss(); |
10 |
} catch (InterruptedException e) { |
11 |
e.printStackTrace(); |
12 |
} |
13 |
} |
14 |
}).start(); |
15 |
} |
1 |
progressDialog = ProgressDialog.show( this , "Please wait...." , "Here your message" ); |
01 |
new Thread( new Runnable(){ |
02 |
public void run(){ |
03 |
try { |
04 |
Thread.sleep(seconds * 1000 ); |
05 |
progressDialog.dismiss(); |
06 |
} catch (InterruptedException e) { |
07 |
e.printStackTrace(); |
08 |
} |
09 |
} |
10 |
}).start(); |
1 |
Thread.sleep(seconds * 1000 ); |
1 |
progressDialog.dismiss(); |
01 | public class SplashScreen extends Activity { |
02 |
03 | //how long until we go to the next activity |
04 | protected int _splashTime = 5000 ; |
05 |
06 | private Thread splashTread; |
07 |
08 | /** Called when the activity is first created. */ |
09 | @Override |
10 | public void onCreate(Bundle savedInstanceState) { |
11 | super .onCreate(savedInstanceState); |
12 | setContentView(R.layout.splash); |
13 |
14 | final SplashScreen sPlashScreen = this ; |
15 |
16 | // thread for displaying the SplashScreen |
17 | splashTread = new Thread() { |
18 | @Override |
19 | public void run() { |
20 | try { |
21 | synchronized ( this ){ |
22 |
23 | //wait 5 sec |
24 | wait(_splashTime); |
25 | } |
26 |
27 | } catch (InterruptedException e) {} |
28 | finally { |
29 | finish(); |
30 |
31 | //start a new activity |
32 | Intent i = new Intent(); |
33 | i.setClass(sPlashScreen, Main. class ); |
34 | startActivity(i); |
35 |
36 | stop(); |
37 | } |
38 | } |
39 | }; |
40 |
41 | splashTread.start(); |
42 | } |
43 |
44 | //Function that will handle the touch |
45 | @Override |
46 | public boolean onTouchEvent(MotionEvent event) { |
47 | if (event.getAction() == MotionEvent.ACTION_DOWN) { |
48 | synchronized (splashTread){ |
49 | splashTread.notifyAll(); |
50 | } |
51 | } |
52 | return true ; |
53 | } |
54 |
55 | } |