Huawei H14-231_V1.0 Practice Test - Questions Answers, Page 14
List of questions
Related questions
Before developing the NFC function, a HarmonyOS developer must first confirm whether the device supports the NFC function and whether the NFC is turned on.
When a developer is developing a HarmonyOS application, if he needs to annotate information for a certain resource file of different types of elements in the Element directory to facilitate the understanding and use of the resource, which of the following methods can be added (XXX represents the comment text)?
If a HarmonyOS developer has developed multiple applications and ensured that the data between different applications cannot be accessed through the triplet of account, application, and database, which of the following services can the developer use to achieve this function?
When the developer jumps to a new page through the button button, the following code is created. If you don't add '' Button button = (Button) findComponentByld(ResourceTable.ld_button) ;' What happens to this line of code?
Public void onStart(Intent intent){
super.onStart(intent);
super.setUlContent
(ResourceTable.Layout_ability_main);
Button button =
(Button)findComponentByld(ResourceTable.ld_button);
button.setClickedListener(listener -> present(new
SecondAbilitySlice(),new Intent()));
}
What events can the next piece of code handle?
When a developer subscribes to a public event, he processes the public event in the onReceiveEvent() callback function and writes the following code.
EventRunner runner = EventRunner.create();
MyEventHandler myHandler = new
MyEventHandler(rurner);
@Override
public void onReceiveEvent(CommonEventData
commonEventData){
final AsyncCommonEventResult
result=goAsyncCommonEvent Runnable task = new
Runnable(){
@override
pub1ic void run {
......
The action to be performed, defined by the developer
result.finishCommonEvent();
}
};
myHandler.postTask(task);
}
How do I define the permissions correctly when a developer needs to customize the permissions for the Harmony OS third-party application?
In the Page Ability lifecycle of HarmonyOS, when the system creates a Page instance for the first time, which of the following callback methods will be triggered first?
If a developer wants to stop the service in a Service, which of the following APIs needs to be called?
When the Page of Harmony OS executes the onForeground() callback, which of the following states will the Page return to first?
Question