Tampilkan postingan dengan label hello world. Tampilkan semua postingan
Tampilkan postingan dengan label hello world. Tampilkan semua postingan

Calling a Service from Activity in Android

Posted by Unknown Rabu, 23 Januari 2013 0 komentar
This is a service class:

public class serv extends Service {
private static final String TAG = "MyService";
AlertDialog alertDialog
@Override
public IBinder onBind(Intent intent) {
// TODO Auto-generated method stub
return null;
}
public void onCreate() {
Toast.makeText(getApplicationContext(), "My Service Created",Toast.LENGTH_LONG).show();
}
@Override
public void onDestroy() {
Toast.makeText(this, "My Service Stopped",Toast.LENGTH_LONG).show();
Log.d(TAG, "onDestroy");
//player.stop();
}
@Override
public void onStart(Intent intent, int startid) {
Toast.makeText(this, "My Service Started",Toast.LENGTH_LONG).show();
Log.d(TAG, "onStart");
//player.start();
}
}
Call service from activity:

public class MainActivity extends Activity {
private static final String TAG = "ServicesDemo";
Button buttonStart, buttonStop;
PendingIntent pendingIntent;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Intent i;
i=new Intent(MainActivity.this,serv.class);
startService(i);
}}

Baca Selengkapnya ....

Display hello world without using semicolon

Posted by Unknown Kamis, 03 Januari 2013 0 komentar

#include<stdio.h>
void main(){
if(printf("Hello world")){
}
}

Baca Selengkapnya ....
Trik SEO Terbaru support Online Shop Baju Wanita - Original design by Bamz | Copyright of android populer.