music.When we clicked the button "play Music and Quit Activity", Musicservice started to play the background music, but the activity was destroyed and the UI interface of the program disappeared. In order to be able to stop playing the background music, we need to click the application icon again, reopen Musicactivity, then click on the "Stop Playing music" button on the interface, we will call the activity StopService method, Android When the framew
Service translated into Chinese is the services, familiar with the Windows system students must be very familiar with. The service in Android is similar to the service function in Windows, where an invisible process executes in the background.Android services, it is different from the activity, it can not interact with the user, can not be started, run in the background of the program, if we quit the application, the service process does not end, it s
( Savedinstancestate); Setcontentview (R.layout.activity_main); Boolean isrunning = Serviceutils.isservicrunning (This, "Com.jrrjw.phonelistener.SystemService"), if (!isrunning) {Intent Intent = new Intent (this, systemservice.class); StartService (intent);} Toast.maketext (This, "System Service is Running", Toast.length_short). Show (); Finish ();}}5. Contents of the manifest file6. The tool class used to determine whether the current service is runningPackage Com.jrrjw.phonelistener;import Ja
Android, using Intent.action_send can achieve a simple "share" function, you can share text, pictures wait for other applications, such as QQ, SMS, etc.Mainactivity.java file:Package Com.example.androidtest;import Java.io.file;import Android.net.uri;import android.os.bundle;import Android.os.environment;import Android.app.activity;import Android.content.intent;import Android.view.Menu;public Class Mainactiv
Android provides the ProgressBar control is divided into two, one is a progress bar without progress, a progress bar with progress, if you can calculate the completion of the task then use a progress bar, if you cannot calculate the amount of the task, then use the progress bar without progress. ProgressBar if only using the system provided, it is very simple, only those attribute methods, but the feeling i
Simpleadapter, like the name, a simple adapter, simple enough to be designed to do simple applications, such as the binding of static data, but still have a custom space, For example, add a button to each ListItem and a response event. First of all, let's look at the definition of simpleadapter, directly translate the SDK Doc:
This is a
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.