📄 midlet.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Wed Sep 24 14:57:50 PDT 2003 -->
<TITLE>
MID Profile: Class MIDlet
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/MIDlet.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<strong>MID Profile</strong></EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV CLASS
NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="MIDlet.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: INNER | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
javax.microedition.midlet</FONT>
<BR>
Class MIDlet</H2>
<PRE>
<A HREF="../../../java/lang/Object.html">java.lang.Object</A>
|
+--<B>javax.microedition.midlet.MIDlet</B>
</PRE>
<HR>
<DL>
<DT>public abstract class <B>MIDlet</B><DT>extends <A HREF="../../../java/lang/Object.html">Object</A></DL>
<P>
A <code>MIDlet</code> is a MID Profile application. The application must extend this class to allow the application management software to control the MIDlet and to be able to retrieve properties from the application descriptor and notify and request state changes. The methods of this class allow the application management software to create, start, pause, and destroy a MIDlet. A <code>MIDlet</code> is a set of classes designed to be run and controlled by the application management software via this interface. The states allow the application management software to manage the activities of multiple <CODE>MIDlets</CODE> within a runtime environment. It can select which <code>MIDlet</code>s are active at a given time by starting and pausing them individually. The application management software maintains the state of the <code>MIDlet</code> and invokes methods on the <code>MIDlet</code> to notify the MIDlet of change states. The <code>MIDlet</code> implements these methods to update its internal activities and resource usage as directed by the application management software. The <code>MIDlet</code> can initiate some state changes itself and notifies the application management software of those state changes by invoking the appropriate methods.<p> <strong>Note:</strong> The methods on this interface signal state changes. The state change is not considered complete until the state change method has returned. It is intended that these methods return quickly.<p>
<P>
<HR>
<P>
<!-- ======== INNER CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected </CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/midlet/MIDlet.html#MIDlet()">MIDlet</A></B>()</CODE>
<BR>
Protected constructor for subclasses.</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/midlet/MIDlet.html#checkPermission(java.lang.String)">checkPermission</A></B>(<A HREF="../../../java/lang/String.html">String</A> permission)</CODE>
<BR>
Get the status of the specified permission.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected abstract void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/midlet/MIDlet.html#destroyApp(boolean)">destroyApp</A></B>(boolean unconditional)</CODE>
<BR>
Signals the <code>MIDlet</code> to terminate and enter the <em>Destroyed</em> state.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../java/lang/String.html">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/midlet/MIDlet.html#getAppProperty(java.lang.String)">getAppProperty</A></B>(<A HREF="../../../java/lang/String.html">String</A> key)</CODE>
<BR>
Provides a <code>MIDlet</code> with a mechanism to retrieve named properties from the application management software.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/midlet/MIDlet.html#notifyDestroyed()">notifyDestroyed</A></B>()</CODE>
<BR>
Used by an <code>MIDlet</code> to notify the application management software that it has entered into the <em>Destroyed</em> state.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/midlet/MIDlet.html#notifyPaused()">notifyPaused</A></B>()</CODE>
<BR>
Notifies the application management software that the MIDlet does not want to be active and has entered the <em>Paused</em> state.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected abstract void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/midlet/MIDlet.html#pauseApp()">pauseApp</A></B>()</CODE>
<BR>
Signals the <code>MIDlet</code> to enter the <em>Paused</em> state.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/midlet/MIDlet.html#platformRequest(java.lang.String)">platformRequest</A></B>(<A HREF="../../../java/lang/String.html">String</A> URL)</CODE>
<BR>
Requests that the device handle (for example, display or install) the indicated URL.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/midlet/MIDlet.html#resumeRequest()">resumeRequest</A></B>()</CODE>
<BR>
Provides a <code>MIDlet</code> with a mechanism to indicate that it is interested in entering the <em>Active</em> state.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected abstract void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/midlet/MIDlet.html#startApp()">startApp</A></B>()</CODE>
<BR>
Signals the <code>MIDlet</code> that it has entered the <em>Active</em> state.</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.<A HREF="../../../java/lang/Object.html">Object</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="../../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../../java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="../../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../../java/lang/Object.html#toString()">toString</A>, <A HREF="../../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="MIDlet()"><!-- --></A><H3>
MIDlet</H3>
<PRE>
protected <B>MIDlet</B>()</PRE>
<DL>
<DD>Protected constructor for subclasses. The application management software is responsible for creating MIDlets and creation of MIDlets is restricted. MIDlets should not attempt to create other MIDlets.<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/SecurityException.html">SecurityException</A></CODE> - unless the application management software is creating the MIDlet.</DL>
</DD>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="startApp()"><!-- --></A><H3>
startApp</H3>
<PRE>
protected abstract void <B>startApp</B>() throws <A HREF="../../../javax/microedition/midlet/MIDletStateChangeException.html">MIDletStateChangeException</A></PRE>
<DL>
<DD>Signals the <code>MIDlet</code> that it has entered the <em>Active</em> state. In the <em>Active</EM> state the <code>MIDlet</code> may hold resources. The method will only be called when the <code>MIDlet</code> is in the <em>Paused</em> state. <p> Two kinds of failures can prevent the service from starting, transient and non-transient. For transient failures the <code>MIDletStateChangeException</code> exception should be thrown. For non-transient failures the <code>notifyDestroyed</code> method should be called. <p> If a Runtime exception occurs during <code>startApp</code> the MIDlet will be destroyed immediately. Its <code>destroyApp</code> will be called allowing the MIDlet to cleanup.<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/microedition/midlet/MIDletStateChangeException.html">MIDletStateChangeException</A></CODE> - is thrown if the <code>MIDlet</code>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -