语言

Menu
Sites
Language
How to call existing setting on a click event?

Hi,

I want to launch existing setting or phone app on a click event. How should I proceed please help

 

编辑者为: Brock Boland 17 3月, 2014 原因: Paragraph tags added automatically from tizen_format_fix module.

响应

3 回复
youngsik yoon
try appcontrol. you can launch them by calling FindAppControlN() with app-id like "tizen.setting", "tizen.phone". please refer to dev guide "Tizen Native App Programming > Programming Guide > App: Controlling Your Application > Application Controls"
Shital Bombarde
I've implemented FindAppControlN as follows:
void Panel2::OnIconListViewItemStateChanged(IconListView &view, int index,
		IconListViewItemStatus status) {
	switch (index) {
	case 0: {
		String uri = L"tel:+919867123456";

		 AppLog("OnIconListViewItemStateChanged:Started");

		 AppControl* pAc = AppManager::FindAppControlN(L"tizen.phone",
		 L"http://tizen.org/appcontrol/operation/dial");

		 AppLog("OnIconListViewItemStateChanged:created phone app");
		 if (pAc)
		 {
		 AppLog("OnIconListViewItemStateChanged:in if..going to start phone app");
		 pAc->Start(&uri, null, null, null);
		 delete pAc;
		 }
	}
		break;
	case 1: {

		HashMap extraData;
		 extraData.Construct();
		 String typeKey = L"http://tizen.org/appcontrol/data/messagetype";
		 String typeVal = L"sms";
		 String textKey = L"http://tizen.org/appcontrol/data/text";
		 String textVal = L"Hi, how are you?";
		 String toKey = L"http://tizen.org/appcontrol/data/to";
		 String toVal = L"2345678900;2345678901;2345678902";
		 extraData.Add(&typeKey, &typeVal);
		 extraData.Add(&textKey, &textVal);
		 extraData.Add(&toKey, &toVal);
		 AppControl*pAc = AppManager::FindAppControlN(L"tizen.messages",
		 L"http://tizen.org/appcontrol/operation/compose");

		 if (pAc)
		 {
		 pAc->Start(null, null, &extraData, null);
		 delete pAc;
		 }
	}
		break;
	default:
		break;
	}
}
. Phone and even Message application is not getting started and my app is terminating. Followings are the app logs: 09-06 04:06:16.270 : INFO / HomeScreen ( 6641 : 6641 ) : virtual result MainForm::OnDraw()(223) > Smart mainForm -Going to draw image ss..... 09-06 04:06:16.290 : INFO / HomeScreen ( 6641 : 6641 ) : virtual void Panel2::OnIconListViewItemStateChanged(Tizen::Ui::Controls::IconListView &, int, Tizen::Ui::Controls::IconListViewItemStatus)(189) > OnIconListViewItemStateChanged:Started 09-06 04:06:16.340 : INFO / HomeScreen ( 6641 : 6641 ) : virtual void Panel2::OnIconListViewItemStateChanged(Tizen::Ui::Controls::IconListView &, int, Tizen::Ui::Controls::IconListViewItemStatus)(194) > OnIconListViewItemStateChanged:created phone app 09-06 04:06:16.340 : INFO / HomeScreen ( 6641 : 6641 ) : virtual void Panel2::OnIconListViewItemStateChanged(Tizen::Ui::Controls::IconListView &, int, Tizen::Ui::Controls::IconListViewItemStatus)(197) > OnIconListViewItemStateChanged:in if..going to start phone app 09-06 04:06:16.340 : ERROR / Tizen::Io ( 2433 : 2440 ) : result Tizen::Io::_DbEnumeratorImpl::GetStringAt(int, Tizen::Base::String&) const(879) > [E_TYPE_MISMATCH] Trying to access column of different type. 09-06 04:06:16.340 : ERROR / Tizen::Io ( 2433 : 2440 ) : result Tizen::Io::_DbEnumeratorImpl::GetStringAt(int, Tizen::Base::String&) const(879) > [E_TYPE_MISMATCH] Trying to access column of different type. 09-06 04:06:16.340 : ERROR / Tizen::Security ( 2433 : 2440 ) : static result Tizen::Security::_PrivilegeManager::RetrieveCipherPrivilegeExN(const Tizen::App::AppId&, Tizen::Base::String&, Tizen::Base::String&, Tizen::Base::Collection::ArrayList*&)(234) > [E_DATA_NOT_FOUND] The privilege information does not exist. 09-06 04:06:16.340 : ERROR / Tizen::Security ( 2433 : 2440 ) : static result Tizen::Security::_PrivilegeManagerServer::RetrievePrivilege(const Tizen::App::AppId&, Tizen::Base::String*, Tizen::Base::String*, Tizen::Base::Collection::ArrayList*&)(72) > [E_DATA_NOT_FOUND] Propagating. 09-06 04:06:16.340 : ERROR / Tizen::Security ( 6641 : 6641 ) : static void Tizen::Security::_AccessController::Initialize()(318) > Failed to retrieve privilege information 09-06 04:06:16.340 : ERROR / Tizen::Security ( 6641 : 6641 ) : static result Tizen::Security::_AccessController::CheckUserPrivilege(Tizen::Security::_Privilege)(364) > [E_DATA_NOT_FOUND] The privilege information does not exist. 09-06 04:06:16.340 : ERROR / Tizen::Security ( 6641 : 6641 ) : static result Tizen::Security::_AccessController::CheckUserPrivilege(Tizen::Security::_Privilege)(405) > [E_PRIVILEGE_DENIED] The application does not have the privilege to call this method. 09-06 04:06:21.600 : ERROR / Tizen::App ( 6641 : 6641 ) : result Tizen::App::AppControl::Start(const Tizen::Base::String*, const Tizen::Base::String*, const Tizen::Base::Collection::IMap*, Tizen::App::IAppControlResponseListener*)(74) > [E_PRIVILEGE_DENIED] The application does not have the privilege to call this method. 09-06 04:06:21.620 : ERROR / Tizen::Base::Collection ( 2425 : 2425 ) : virtual result Tizen::Base::Collection::ArrayList::IndexOf(const Tizen::Base::Object&, int, int, int&) const(290) > [E_OBJ_NOT_FOUND] The arraylist is empty. 09-06 04:06:21.620 : ERROR / Tizen::Base::Collection ( 2425 : 2425 ) : virtual result Tizen::Base::Collection::ArrayList::Remove(const Tizen::Base::Object&)(393) > [E_OBJ_NOT_FOUND] Propagating. 09-06 04:06:21.620 : ERROR / Tizen::Io ( 2425 : 2425 ) : result Tizen::Io::_DbEnumeratorImpl::GetStringAt(int, Tizen::Base::String&) const(879) > [E_TYPE_MISMATCH] Trying to access column of different type. 09-06 04:06:21.620 : ERROR / Tizen::Io ( 2425 : 2425 ) : result Tizen::Io::_DbEnumeratorImpl::GetIntAt(int, int&) const(810) > [E_TYPE_MISMATCH] Trying to access column of different type. 09-06 04:06:21.620 : ERROR / Tizen::Io ( 2425 : 2425 ) : result Tizen::Io::_DbEnumeratorImpl::GetStringAt(int, Tizen::Base::String&) const(879) > [E_TYPE_MISMATCH] Trying to access column of different type. Any idea why it is getting failed???
Shital Bombarde
I've added Privilege as http://tizen.org/api/application.launch to my manifest file. Now I'm able to launch other apps.