<commit_before>package com.example.pluginmain;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map.Entry;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.plugin.core.PluginDescriptor;
import com.plugin.core.PluginLoader;
import com.plugin.core.ui.PluginDispatcher;

public class PluginListActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main_activity);
		LinearLayout root = (LinearLayout) findViewById(R.id.root);
		TextView text = new TextView(this);
		text.setText("注意：插件Fragment如果运行在和它的开发方式不匹配的运行容器中，会出错，\n" +
				"" +
				"如下列表中会对这种异常进行演示");
		text.setTextSize(16);
		root.addView(text);
		
		// 这行代码应当在Application的onCreate中执行。
		PluginLoader.initLoader(getApplication());

		HashMap<String, PluginDescriptor> plugins = PluginLoader.listAll();

		Iterator<Entry<String, PluginDescriptor>> it = plugins.entrySet().iterator();
		while (it.hasNext()) {
			<commit_msg>在显示插件列表的地方添加注释<commit_after>package com.example.pluginmain;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map.Entry;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.plugin.core.PluginDescriptor;
import com.plugin.core.PluginLoader;
import com.plugin.core.ui.PluginDispatcher;

public class PluginListActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main_activity);
		LinearLayout root = (LinearLayout) findViewById(R.id.root);
		TextView text = new TextView(this);
		text.setText("注意：插件Fragment如果运行在和它的开发方式不匹配的运行容器中，会出错，\n" +
				"" +
				"如下列表中会对这种异常进行演示");
		text.setTextSize(16);
		root.addView(text);
		
		// 这行代码应当在Application的onCreate中执行。
		PluginLoader.initLoader(getApplication());

		//安装一个插件
		//PluginLoader.installPlugin("/sdcard/test/test.apk");
		
		//列出所有已经安装的插件
		HashMap<String, PluginDescriptor> plugins = PluginLoader.listAll();

		Iterator<Entry<String, PluginDescriptor>> it = plugins.entrySet().iterator();
		while (it.hasNext()) {
			
{'fraction_non_alphanumeric': 0.1169024571854058, 'fraction_numerical': 0.0014892032762472078, 'mean_word_length': 5.7175, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4822138', 'n_tokens_mistral': 959, 'n_tokens_neox': 896, 'n_words': 147}