当前位置: 首页>>代码示例>>Java>>正文


Java CollectLogs类代码示例

本文整理汇总了Java中com.csipsimple.utils.CollectLogs的典型用法代码示例。如果您正苦于以下问题:Java CollectLogs类的具体用法?Java CollectLogs怎么用?Java CollectLogs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


CollectLogs类属于com.csipsimple.utils包,在下文中一共展示了CollectLogs类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getCustomView

import com.csipsimple.utils.CollectLogs; //导入依赖的package包/类
public View getCustomView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  	View v = inflater.inflate(R.layout.help, container, false);
      ListView lv = (ListView) v.findViewById(android.R.id.list);
      lv.setOnItemClickListener(this);
      
      
      ArrayList<HelpEntry> items = new ArrayList<HelpEntry>();

      // FAQ
if(!TextUtils.isEmpty(CustomDistribution.getFaqLink())) {
	items.add(new HelpEntry(android.R.drawable.ic_menu_info_details, R.string.faq, FAQ));
}

// Issue list 
if(CustomDistribution.showIssueList()) {
	items.add(new HelpEntry(android.R.drawable.ic_menu_view, R.string.view_existing_issues, OPEN_ISSUES));
}

// Log collector
if(!TextUtils.isEmpty(CustomDistribution.getSupportEmail()) ) {
	if(isRecording()) {
        items.add(new HelpEntry( android.R.drawable.ic_menu_send , R.string.send_logs, SEND_LOGS));
	}else {
        items.add(new HelpEntry( android.R.drawable.ic_menu_save , R.string.record_logs, START_LOGS));
	}
}

      items.add(new HelpEntry(android.R.drawable.ic_menu_gallery, R.string.legal_information, LEGALS));
      
      if(NightlyUpdater.isNightlyBuild(getActivity())){
	items.add(new HelpEntry(R.drawable.ic_launcher_nightly, R.string.update_nightly_build, NIGHTLY));
}

      lv.setAdapter(new HelpArrayAdapter(getActivity(), items));
      
      TextView tv = (TextView) v.findViewById(android.R.id.text1);
      tv.setText(CollectLogs.getApplicationInfo(getActivity()));
      
      return v;
  }
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:41,代码来源:Help.java

示例2: onItemClick

import com.csipsimple.utils.CollectLogs; //导入依赖的package包/类
@Override
public void onItemClick(AdapterView<?> av, View v, int position, long id) {
       Log.i(THIS_FILE, "Item clicked : " + id +" " + position);
	HelpArrayAdapter haa = (HelpArrayAdapter) av.getAdapter();
	HelpEntry he = haa.getItem(position);
	
	SherlockDialogFragment newFragment;
	switch (he.choiceTag) {
	case FAQ:
		newFragment = Faq.newInstance();
        newFragment.show(getFragmentManager(), "faq");
		break;
	case LEGALS:
		newFragment = Legal.newInstance();
        newFragment.show(getFragmentManager(), "issues");
		break;
	case OPEN_ISSUES:
		Intent it = new Intent(Intent.ACTION_VIEW);
		it.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
		it.setData(Uri.parse("http://code.google.com/p/csipsimple/issues"));
		startActivity(it);
		break;
	case NIGHTLY:
		// We have to check for an update
		final NightlyUpdater nu = new NightlyUpdater(getActivity());
		Thread t = new Thread() {
			public void run() {
				UpdaterPopupLauncher ru = nu.getUpdaterPopup(true);
				if (ru != null) {
					getActivity().runOnUiThread(ru);
				}
			};
		};
		t.start();
		break;
	case SEND_LOGS:
		prefsWrapper.setPreferenceStringValue(SipConfigManager.LOG_LEVEL, "1");
		try {
			startActivityForResult(CollectLogs.getLogReportIntent("<<<PLEASE ADD THE BUG DESCRIPTION HERE>>>", getActivity()), REQUEST_SEND_LOGS);
		}catch(Exception e) {
			Log.e(THIS_FILE, "Impossible to send logs...", e);
		}
		Log.setLogLevel(1);
		break;
	case START_LOGS:
		prefsWrapper.setPreferenceStringValue(SipConfigManager.LOG_LEVEL, "4");
		Log.setLogLevel(4);
		Intent intent = new Intent(SipManager.ACTION_SIP_REQUEST_RESTART);
		getActivity().sendBroadcast(intent);
		dismiss();
		break;
	default:
		break;
	}
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:56,代码来源:Help.java


注:本文中的com.csipsimple.utils.CollectLogs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。