最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Android上使用jspf插件框架的方法

 更新時(shí)間:2015年06月29日 11:00:54   作者:紅薯  
這篇文章主要介紹了Android上使用jspf插件框架的方法,實(shí)例分析了jspf插件框架的功能與使用技巧,需要的朋友可以參考下

本文實(shí)例講述了Android上使用jspf插件框架的方法。分享給大家供大家參考。具體如下:

jspf (Java Simple Plugin Framework) 是一個(gè)插件框架,集成了很多 IoC 框架的概念在里面。

package de.jspfdemo;
import net.xeoh.plugins.base.PluginManager;
import net.xeoh.plugins.base.impl.PluginManagerFactory;
import net.xeoh.plugins.base.util.uri.ClassURI;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
import de.jspfdemo.plugins.CoolPlugin;
import de.jspfdemo.plugins.impl.CoolPluginImpl;
public class JSPFDemo extends Activity {
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    // Loading and adding plugins via class uri
    PluginManager pm = PluginManagerFactory.createPluginManager();
    pm.addPluginsFrom(new ClassURI(CoolPluginImpl.class).toURI());
    // Getting the CoolPlugin
    CoolPlugin plugin = pm.getPlugin(CoolPluginImpl.class);
    // Setting the text of a TextView with the help of the CoolPlugin
    TextView textView = (TextView) findViewById(R.id.textView);
    textView.setText(plugin.sayHello());
  }
}

希望本文所述對(duì)大家的Android程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論

德阳市| 宜州市| 通州市| 黑龙江省| 运城市| 烟台市| 安泽县| 长岛县| 遵义市| 澜沧| 德兴市| 岚皋县| 镇安县| 兴海县| 新晃| 龙胜| 澄江县| 西昌市| 东乡族自治县| 寿阳县| 峨山| 安康市| 增城市| 即墨市| 稷山县| 永嘉县| 阿拉善盟| 福建省| 黔南| 韶关市| 磴口县| 伊吾县| 安福县| 余江县| 定兴县| 阳东县| 阿图什市| 延津县| 白银市| 和林格尔县| 蒲城县|