Since: Knox API Level 14
public class

PowerItem

extends Object
implements Parcelable
java.lang.Object
   ↳ com.samsung.android.knox.custom.PowerItem

Class Overview

This class defines a custom items in the power dialog option.

Since
API level 14
Version 2.0

Summary

Constants
int ACTION_SEND_BROADCAST Define a SEND_BROADCAST intent.
int ACTION_SEND_STICKY_BROADCAST Define a SEND_STICKY_BROADCAST intent.
int ACTION_START_ACTIVITY Define a START_ACTIVITY intent.
[Expand]
Inherited Constants
From interface android.os.Parcelable
Public Constructors
PowerItem(int id, BitmapDrawable icon, Intent intent, int intentAction, String text)
Class constructor.
Public Methods
int describeContents()
Not implemented.
BitmapDrawable getIcon()
This method gets the Icon, internal member assigned in the constructor.
int getId()
This method gets the Id, internal member assigned in the constructor.
Intent getIntent()
This method gets the Intent, internal member assigned in the constructor.
int getIntentAction()
This method gets the intent action, internal member assigned in the constructor.
String getText()
This method gets the text string, internal member assigned in the constructor.
String toString()
This method returns the string representation of this class instance.
void writeToParcel(Parcel out, int flags)
This method flatten this object in to a Parcel (out).
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Constants

public static final int ACTION_SEND_BROADCAST

Since: Knox API Level 28

Define a SEND_BROADCAST intent.

Constant Value: 1 (0x00000001)

public static final int ACTION_SEND_STICKY_BROADCAST

Since: Knox API Level 28

Define a SEND_STICKY_BROADCAST intent.

Constant Value: 2 (0x00000002)

public static final int ACTION_START_ACTIVITY

Since: Knox API Level 28

Define a START_ACTIVITY intent.

Constant Value: 4 (0x00000004)

Public Constructors

public PowerItem (int id, BitmapDrawable icon, Intent intent, int intentAction, String text)

Since: Knox API Level 14

Class constructor.

Parameters
id an item identifier.
icon the icon drawn on the left of the item.
intent the intent fired on user click.
intentAction the way the intent is fired, ACTION_SEND_BROADCAST, ACTION_SEND_STICKY_BROADCAST or ACTION_START_ACTIVITY.
text the text set on the right of the icon.
Usage

 PowerItem item = new new PowerItem(1,

                (BitmapDrawable) getResources().getDrawable(com.test.app),

                intent,

                PowerItem.ACTION_START_ACTIVITY,

                "ACTION_START_ACTIVITY");

 
Since
API level 14
Version 2.0

Public Methods

public int describeContents ()

Since: Knox API Level 14

Not implemented.

Returns
  • Always 0.
Since
API level 14
Version 2.0

public BitmapDrawable getIcon ()

Since: Knox API Level 14

This method gets the Icon, internal member assigned in the constructor.

Returns
  • Icon assigned in the constructor.
Since
API level 14
Version 2.0

public int getId ()

Since: Knox API Level 14

This method gets the Id, internal member assigned in the constructor.

Returns
  • Id assigned in the constructor.
Since
API level 14
Version 2.0

public Intent getIntent ()

Since: Knox API Level 14

This method gets the Intent, internal member assigned in the constructor.

Returns
  • Intent assigned in the constructor.
Since
API level 14
Version 2.0

public int getIntentAction ()

Since: Knox API Level 14

This method gets the intent action, internal member assigned in the constructor.

Returns
  • Intent action assigned in the constructor.
Since
API level 14
Version 2.0

public String getText ()

Since: Knox API Level 14

This method gets the text string, internal member assigned in the constructor.

Returns
  • Text string assigned in the constructor.
Since
API level 14
Version 2.0

public String toString ()

Since: Knox API Level

This method returns the string representation of this class instance.

Returns
  • String representation of this class instance.
Since
API level 14
Version 2.0

public void writeToParcel (Parcel out, int flags)

Since: Knox API Level 14

This method flatten this object in to a Parcel (out).

Parameters
out The parcel where the data is written.
flags Not used.
Since
API level 14
Version 2.0