安卓,null expection,说FragmentManagerImpl什么的,求解决

先上logcat:

图片说明
图片说明

估计和viewpager有关,下面上viewpager的布局:

 <?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent"
    android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin"

    tools:showIn="@layout/activity_main" tools:context=".MainActivity"
    android:id="@+id/drawerlayout">




        <android.support.v4.view.ViewPager
            android:id="@+id/viewpager"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>

    <ListView
        android:id="@+id/listview"
        android:layout_width="240dp"
        android:layout_height="match_parent"
        android:background="#3366cc">

    </ListView>

</android.support.v4.widget.DrawerLayout>

下面是FragmentPagerAdapter:

 public class MyFragmentPagerAdapter extends FragmentPagerAdapter
{
    List<Fragment> list;
    String[] titles;
    public Fragment getItem(int position)
    {
        return list.get(position);

    }
    public int getCount()
    {
        return list.size();
    }
    MyFragmentPagerAdapter(FragmentManager fm,List<Fragment> list,String[] titles)
    {
        super(fm);
        this.list=list;
        this.titles=titles;
    }
    public String getTitle(int position)
    {
        return titles[position];
    }

}

MainActivity中和viewpager有关的部分:

  listFragment=new ArrayList<Fragment>();
        listFragment.add(f1);
        listFragment.add(f2);
        listFragment.add(f3);
        listFragment.add(f4);
        listFragment.add(f5);
        viewPager=(ViewPager)super.findViewById(R.id.viewpager);
        fragmentPagerAdapter=new MyFragmentPagerAdapter(getSupportFragmentManager(),listFragment,new String[]{"标签1","标签2","标签3","标签4","标签5"});
       viewPager.setAdapter(fragmentPagerAdapter);
        tabLayout=(TabLayout)super.findViewById(R.id.tablayout);
        for(int i=0;i<5;i++)
        {
            tabLayout.addTab(tabLayout.newTab().setText("标签"+i));
        }
        tabLayout.setTabMode(TabLayout.MODE_FIXED);
        tabLayout.setupWithViewPager(viewPager);

求教怎么解决?

0

1个回答

0
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Expection of String
Problem DescriptionnFrog has just learned how to multiply two numbers. Now he wants to do some exercise.nnHe wrote a string on the paper, which only contains digits and a single × as the operator. If the × appears at the front or the end of the string, he regards the result as zero, otherwise he does the calculation as a normal multiplication.nnAfter some play, he wonders a new problem: for a initial string, each time he randomly choose two characters and swap their positions. He will do this again and again, say for K times, he wants to know the expected calculation result for the newest string that he gets.nnIt can be shown that their can be (n2)K ways(Same as (C2n)K) for the whole swap operations, so if the expected result is x, you need to output x×(n2)K as an integer.n nnInputnFirst line contains an integer T, which indicates the number of test cases.nnEvery test case begins with an integers K, which is the numbers of times the Frog can swap characters.nnThe second line of each test case contains the string Frog plays with, which only contains digits and exactly one multiplication operator, written as '∗'.nn⋅ 1≤T≤100.nn⋅ the string's length is L.nn⋅ for 70% data, 1≤L≤10 and 0≤K≤5.nn⋅ for 95% data, 1≤L≤20 and 0≤K≤20. nn⋅ for 100% data, 1≤L≤50 and 0≤K≤50.n nnOutputnFor every test case, you should output "Case #x: y", where x indicates the case number and counts from 1 and y is the result.nnBecause y could be very large, just mod it with 109+7.n nnSample Inputn2n1n1*2n2n1*2n nnSample OutputnCase #1: 2nCase #2: 6n n
求解决NULL的问题
库中有NULL值,在搜索时空值 "" 不能匹配rn又因字段太多,如果在每个字段都加上 or xxx="NULL" 又太麻烦,高手有何良方?rn谢谢
不知道说什么的小记
曾经的考研第一志愿初试过了,然后复试炸了,答复说是笔试成绩太差,很惋惜,很忧伤了那一段时间。当时是玩游戏太过分了,确实,很疯狂的玩游戏,这锅是要背的。没心情搞毕设?差点被当初的毕设老师给挂了,呵呵。毕设这东西真的是水到爆炸了,然后一志愿被挂了得背点锅吧。不过现在在新学校也还不错啦,因为有了皮皮佳吧~所谓的忘掉过去悲伤的方法是找到新欢?但是当上周日听到小胖说的,我去年被刷掉的原因究竟是啥呢? 我后面
关于Unhandled Expection 的请教
我的程序出错:rnUnhandled exception in Capture.exe(AVICAP32.DLL) : 0xC0000005 : Access rnViolation rn什麽情况下会出现Access Violation ?rn出错的函数是:rncapSetVideoFormat(m_hCapWnd, &m_BitmapInfo, sizeof(m_BitmapInfo)) rn请高手指点!!
cvFitEllipse2 cv::Expection
用这段代码想画出轮廓的最小外接椭圆,生成成功可是执行到cvFitEllipse那句时老是报异常n![图片说明](https://img-ask.csdn.net/upload/201507/26/1437897156_871439.png)n说cv::Expectionn![图片说明](https://img-ask.csdn.net/upload/201507/26/1437897175_449250.png)n可是也查不出来是什么异常。。。请大神们帮忙看看n另:总是出现cv::Expection的问题,有时候改改又好了,怎么才能知道是具体什么异常呢
VS2015 安卓SDK求解决
之前还有,几天后就变成这样了,如何解决?rn[img=https://img-bbs.csdn.net/upload/201702/13/1486976265_390479.png][/img]rn之前帖子:[url=http://bbs.csdn.net/topics/392077599]http://bbs.csdn.net/topics/392077599[/url]
长青说安卓
长青说安卓 android快速入门知识
JAVA Expection 异常 笔记整理
 产生异常的原因多种多样,大致有: 系统资源不可用,如,内存分配失败,文件打开失败,数据库打开失败 程序控制不当,如,除数为零,负数开方 当发生异常的时候,系统会: 1、发生异常的部分,产生系统定义的错误信息 2、程序意外终止,将控制权返回系统 3、程序中对所有已分配资源的状态保持不变,这样会导致资源泄漏 所以我们需要对异常进行处理 try{...........   //需
findViewById返回null,求大神解决。
本人Android新手rn//MainActivity.javarn[code=java]rnpackage com.hipad.checkboxtext;rnrnimport android.os.Bundle;rnimport android.support.v4.app.Fragment;rnimport android.support.v7.app.ActionBarActivity;rnimport android.view.LayoutInflater;rnimport android.view.Menu;rnimport android.view.MenuItem;rnimport android.view.View;rnimport android.view.View.OnClickListener;rnimport android.view.ViewGroup;rnimport android.widget.CheckBox;rnrnpublic class MainActivity extends ActionBarActivity rnrn private CheckBox eat = null;rn private CheckBox sleep = null;rn private CheckBox all = null;rn @Overridern protected void onCreate(Bundle savedInstanceState) rn super.onCreate(savedInstanceState);rn setContentView(R.layout.activity_main);rnrn if (savedInstanceState == null) rn getSupportFragmentManager().beginTransaction()rn .add(R.id.container, new PlaceholderFragment()).commit();rn rn eat = (CheckBox)findViewById(R.id.eat);rn System.out.println(R.id.eat+"...");rn sleep = (CheckBox)findViewById(R.id.sleep);rn all = (CheckBox)findViewById(R.id.all);rn OnclickCheckBox check = new OnclickCheckBox();rn System.out.println(check);rn if(eat == null)rn System.out.println("eat=null!");rn if(check == null)rn System.out.println("check=null");rn eat.setOnClickListener(check);rn //sleep.setOnClickListener(check);rn //all.setOnClickListener(check);rn rn rnrn @Overridern public boolean onCreateOptionsMenu(Menu menu) rnrn // Inflate the menu; this adds items to the action bar if it is present.rn getMenuInflater().inflate(R.menu.main, menu);rn return true;rn rnrn @Overridern public boolean onOptionsItemSelected(MenuItem item) rn // Handle action bar item clicks here. The action bar willrn // automatically handle clicks on the Home/Up button, so longrn // as you specify a parent activity in AndroidManifest.xml.rn int id = item.getItemId();rn if (id == R.id.action_settings) rn return true;rn rn return super.onOptionsItemSelected(item);rn rn rn //实现onclick方法rn class OnclickCheckBox implements OnClickListenerrnrn @Overridern public void onClick(View v) rn CheckBox box = (CheckBox)v;rn if(box.getId() == R.id.eat)rn System.out.println("i am eating");rn rn else if(box.getId() == R.id.sleep)rn System.out.println("i am sleeping");rn rn elsern rn rn rn rn rn rn rnrn /**rn * A placeholder fragment containing a simple view.rn */rn public static class PlaceholderFragment extends Fragment rnrn public PlaceholderFragment() rn rnrn @Overridern public View onCreateView(LayoutInflater inflater, ViewGroup container,rn Bundle savedInstanceState) rn View rootView = inflater.inflate(R.layout.fragment_main, container,rn false);rn return rootView;rn rn rnrnrn[/code]rnrn//res.fragment_main.xmlrn[code=text]rnrnrnrn rn rn rnrnrnrn[/code]rnrn//activity_main.xmlrn[code=text]rnrnrn[/code]rn
Expection Maxmization demo matlab code
Expection Maxmization demo matlab code
求日期什么的
#includeint month[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};char Month[13][10]={"","January","February","March","April","May","June","July","August","September","October","November","December"};char DayofWeek[7][10]={"Monday","Tuesday","Wednesday","Thurs
安卓BitmapFactory.decodeStream()返回null的问题解决方法
今天遇到了一个问题,最终解决,记录下解决方案: 问题:从网络获取图片,数据为InputStream流对象,然后调用BitmapFactory的decodeStream()方法解码获取图片,返回null。 ------------------------------------------------- 代码如下: [java] view plain co
安卓程序调试时挂掉,求解决!
ActivityThread.performLaunchActivity(ActivityThread.java:2663) source not foundrn
求高手解决安卓模拟去安装失败
Failed to fetch URL http://dl-ssl.google.com/android/repository/repository.xml, reason: Connection timed out: connect
安卓集成微信支付,遇到大坑,求解决?
正在集成微信支付,已经能调通支付了,并且支付成功了,但是有一个大问题,每次必须清除微信的数据才能成功,要不然就会返回-1支付失败,求大神帮助,已经卡在这里很长时间了,项目其他已经做完了,就差这一点,求帮助!
安卓UI卡 贴出代码求解决
package com.example.bmvod.myapplication;nnimport java.util.Timer;nimport java.util.TimerTask;nnimport android.database.Cursor;nimport android.database.sqlite.SQLiteDatabase;nimport android.os.Bundle;nimport android.os.Handler;nimport android.os.Message;nimport android.app.Activity;nimport android.graphics.drawable.ClipDrawable;nimport android.text.Editable;nimport android.text.TextWatcher;nimport android.widget.Button;nimport android.widget.CompoundButton;nimport android.widget.EditText;nimport android.widget.ImageView;nimport android.widget.ToggleButton;nnimport com.example.bmvod.myapplication.R;nnpublic class MainActivity extends Activity n private boolean suspend = true;n Timer timer;n private ImageView IV;n private SQLiteDatabase db;n private final String DATABASE_PATH = "/mnt/mmcblk1/mmcblk1p1/SQL";n private String DATABASE_FILENAME = "song(1).db";n private EditText eT;nn @Overriden protected void onCreate(Bundle savedInstanceState) n // final Button button = (Button) findViewById(R.id.bbttn);n super.onCreate(savedInstanceState);n setContentView(R.layout.activity_main);n eT = (EditText) findViewById(R.id.EDT0);n String databaseFilename = DATABASE_PATH + "/" + DATABASE_FILENAME;n db = SQLiteDatabase.openOrCreateDatabase(databaseFilename, null);n eT.addTextChangedListener(new TextWatcher() n @Overriden public void beforeTextChanged(CharSequence s, int start, int count, int after) nn nn @Overriden public void onTextChanged(CharSequence s, int start, int before, int count) n Cursor c = null;n c = db.rawQuery("SELECT count(*) as a FROM song where SongName like '%" + eT.getText() + "%'", null);n while (c.moveToNext()) n int cou = c.getInt(c.getColumnIndex("a"));n //a Log.i("a", String.valueOf(cou));n System.out.println(cou);n n nn @Overriden public void afterTextChanged(Editable s) nn n );nnn IV = (ImageView) findViewById(R.id.img);n final ImageView imageView = (ImageView) findViewById(R.id.image);n imageView.setBackgroundResource(R.drawable.imagelong8);n final ClipDrawable drawable = (ClipDrawable) imageView.getDrawable();n ToggleButton toggleButton = (ToggleButton) findViewById(R.id.togbtn);n toggleButton.setText("播放");n toggleButton.setTextOn("暂停");n toggleButton.setTextOff("播放");n final int[] imageId = new int[]R.drawable.imagelong10, R.drawable.imagelong3, R.drawable.imagelong5, R.drawable.imagelong8, R.drawable.imagelong7, R.drawable.imagelong6n , R.drawable.imagelong10, R.drawable.imagelong3, R.drawable.imagelong5, R.drawable.imagelong8, R.drawable.imagelong7, R.drawable.imagelong6,n R.drawable.imagelong10, R.drawable.imagelong3, R.drawable.imagelong5, R.drawable.imagelong8, R.drawable.imagelong7, R.drawable.imagelong6,n R.drawable.imagelong10, R.drawable.imagelong3, R.drawable.imagelong5, R.drawable.imagelong8, R.drawable.imagelong7, R.drawable.imagelong6,n R.drawable.imagelong10, R.drawable.imagelong3, R.drawable.imagelong5, R.drawable.imagelong8, R.drawable.imagelong7, R.drawable.imagelong6,n R.drawable.imagelong10, R.drawable.imagelong3, R.drawable.imagelong5, R.drawable.imagelong8, R.drawable.imagelong7, R.drawable.imagelong6,n R.drawable.imagelong10, R.drawable.imagelong3, R.drawable.imagelong5, R.drawable.imagelong8, R.drawable.imagelong7, R.drawable.imagelong6,n R.drawable.imagelong10, R.drawable.imagelong3, R.drawable.imagelong5, R.drawable.imagelong8, R.drawable.imagelong7, R.drawable.imagelong6,n R.drawable.imagelong10, R.drawable.imagelong3, R.drawable.imagelong5, R.drawable.imagelong8, R.drawable.imagelong7, R.drawable.imagelong6,n R.drawable.imagelong10, R.drawable.imagelong3, R.drawable.imagelong5, R.drawable.imagelong8, R.drawable.imagelong7, R.drawable.imagelong6,n R.drawable.imagelong10, R.drawable.imagelong3, R.drawable.imagelong5, R.drawable.imagelong8, R.drawable.imagelong7, R.drawable.imagelong6,n R.drawable.imagelong10, R.drawable.imagelong3, R.drawable.imagelong5, R.drawable.imagelong8, R.drawable.imagelong7, R.drawable.imagelong6,n R.drawable.imagelong10, R.drawable.imagelong3, R.drawable.imagelong5, R.drawable.imagelong8, R.drawable.imagelong7, R.drawable.imagelong6,n R.drawable.imagelong10, R.drawable.imagelong3, R.drawable.imagelong5, R.drawable.imagelong8, R.drawable.imagelong7, R.drawable.imagelong6,n R.drawable.imagelong10, R.drawable.imagelong3, R.drawable.imagelong5, R.drawable.imagelong8, R.drawable.imagelong7, R.drawable.imagelong6,n R.drawable.imagelong10, R.drawable.imagelong3, R.drawable.imagelong5, R.drawable.imagelong8, R.drawable.imagelong7, R.drawable.imagelong6,n R.drawable.imagelong10, R.drawable.imagelong3, R.drawable.imagelong5, R.drawable.imagelong8, R.drawable.imagelong7, R.drawable.imagelong6n ;n final Handler handler = new Handler() nn @Overriden public void handleMessage(Message msg) n if (msg.what <= imageId.length - 1) n IV.setImageResource(imageId[msg.what]);n // Animation animation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.translate);n // IV.startAnimation(animation);n n n ;n new Thread(new Runnable() n int i = 0;nn @Overriden public void run() n while (true) n handler.sendEmptyMessage(i++);n try n Thread.sleep(100);n catch (InterruptedException e) n e.printStackTrace();n n n n ).start();nn final Handler handler1 = new Handler() n @Overriden public void handleMessage(Message msg) n // TODO Auto-generated method stubn /* if (msg.what == 0x123) n drawable.setLevel(drawable.getLevel() + 1);n */n if (msg.what == 0x123) n drawable.setLevel(drawable.getLevel() + 1);n n n ;n//我6472 我们446n toggleButton.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() n @Overriden public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) nn if (suspend == true) n //获取图片所显示的ClipDrawable对象n timer = new Timer();nn timer.schedule(new TimerTask() n int a = 0;nn @Overriden public void run() n Message msg = new Message();n msg.what = 0x123;n handler1.sendMessage(msg);nn if (drawable.getLevel() >= 10000) n timer.cancel();n n n , 0, 1);n suspend = false;n else n timer.cancel();n timer = null;n suspend = true;n n n );n nnnnn```n n```nn两个线程发消息刷新UI,然后EditText输入信息查询数据库,当EditText输入一个字的时候UI就卡一下。。请问怎么解决?问题出在我的 eT.addTextChangedListener(new TextWatcher()这里?还是。。。。。。。?
求安卓大神解决一下问题
这个是我写的一个安卓软件,打算运行下,但是没有报错,就是不能运行,一运行就会崩溃,这是什么问题呢? 哪位大神可以解决下。 谢谢这个是eclipse中虚拟机的报错信息:这个是在eclipse中调试的信息:显示报错是无法找到来源???这是什么意思  要怎么解决呢??总之,进去就会崩溃,不现实界面。那位安卓大神解决下  万分感谢---。。----...
说一下安卓的touch事件分发机制
先从事件的传递开始.一个事件到达界面时, 它的入口是dispatchTouchEvent. 这个方法是视图处理事件的唯一接口, 所有到达视图的事件, 都必须经过这个方法.简单地说, 系统接收到一个事件, 要丢到一个LinearLayout里面, 怎么办?直接调这个dispatchTouchEvent, 接收返回的true或者false, 完了.后面的处理就和这个LinearLayout没关系了.那...
长青说安卓系列(8章)
长青说安卓系列 从android 内核编译到开发
Fragment相关源码阅读笔记(3)FragmentManagerImpl
FragmentManagerImpl类是FragmentManager抽象类的具体实现,负责Fragment 的管理,主要有三方面的功能:          1/Fragment管理,添加移除等(add/remove/replace/hide/show)          2/事务管理,对Transactions的操作,addToBackStack和popBackStack        
如何解决Null异常
最近学习java的数据库编程,在Applet中使用了jdbc-odbc,并使用了jdbl的gird组件,在appletViewer中一切正常,但是在ie就出现了Null异常警告错误,何解?
解决 create JAXBContext null
NULL 博文链接:https://tsar198512.iteye.com/blog/333109
翻译:重载解决和Null
原文:http://msmvps.com/blogs/Senthil/Overload resolution and null最近在努力学习英语,所以决定自己来翻译一些c#和.NET相关的技术文章,既可学习英语,又能学习到c#和.NET的技术,可谓是一举两得的事情。如果翻译不到位,请谅解,也希望能得到大家友善的指正。我的同事Soundar发现一个相当有趣的行为1: class Test 2: ...
解决NULL的问题
我需要几个字段相加 select a+b from c 可是a里面有几个NULL值 这样加出来 就算B有值 结果也是NULLrn 请问如何解决这个问题? 如何让 NULL+8=8 ?
怎样解决“NULL”值?
小弟刚接触VB的数据库,很多东西不懂。所以请各位帮忙解决下面的问题。rn在用MSFlexGrid显示一个表,当表中的某个字段为空,输入内容时就会出现一个“无效使用NULL”的错误。rn我试图用下面的语句来跳过它,可在测试中发现它根本不执行IF里面的语句。rnIf Data1.Recordset.Fields(I).Value = Null Thenrn MsgBox ""rn GoTo NextirnEnd Ifrn我也把上面条件中的“NULL”换为“”(空字符)试过,可一样不行。rn是不是我上面的条件不对还是别的错误?rn我该怎样才能正常地在MSFlexGrid中显示一个表中某个字段的空记录(表中某个字段的空记录无法避免)rn下面是相关的代码,因为用于测试,所以用了FOR循环。原循环条件我没写。rnRow1 = 0rnFor j = 0 To 10rnMSFlexGrid1.Rows = MSFlexGrid1.Rows + 1 '增加表1的总行数rnRow1 = Row1 + 1 '行变量rn For I = 0 To Col1 - 1rn If Data1.Recordset.Fields(I).Value = Null Thenrn MsgBox ""rn GoTo Nextirn End Ifrn MSFlexGrid1.TextMatrix(Row1, I) = Data1.Recordset.Fields(I).Value '逐行输入数据rnNexti:rn Next Irn Data1.Recordset.MoveNext '移动到下一条记录rnNext j
main方法 注入null解决
问题: java使用main方法作为入口,测试service时,发现使用@Autowired注入,总是报java.lang.NullPointerException异常 原因: new出来的thread不在spring的容器中,所以无法注入成功,获得bean 解决: ApplicationContext springUtilContext = new ClassPathXmlAppli...
求解决,求解决,求解决
如果一个list里全是用的同一个String对象 那就意味着 你改了一条数据 那么其他所有的数据就全都会改变 因为你操作的是同一个对象n第一次添加一个城市,一个天气,再添加一个城市,就出现覆盖以前的城市的天气![图片](https://img-ask.csdn.net/upload/201609/24/1474716261_116615.jpeg)![图片](https://img-ask.csdn.net/upload/201609/24/1474716446_203625.jpeg)![图片](https://img-ask.csdn.net/upload/201609/24/1474716462_394342.jpeg)![图片](https://img-ask.csdn.net/upload/201609/24/1474716553_125235.jpeg)![图片](https://img-ask.csdn.net/upload/201609/24/1474716706_755403.jpeg)![图片](https://img-ask.csdn.net/upload/201609/24/1474716713_812521.jpeg)![图片](https://img-ask.csdn.net/upload/201609/24/1474716575_865323.jpeg)
最大子序列和 到底是求什么的和啊?
[code=C/C++]rn//请大家帮我解释一下maxSubSum函数!最好逐步解释。rnint maxSubSum( const vector &a)rnrn int maxSum = 0;rn for(int i=0; i<(int)a.size(); ++i)rn rn for(int j=i; j<(int)a.size(); ++j)rn rn int thisSum = 0;rn for(int k=i; k<=j; ++k)rn rn thisSum += a[k];rn rn if(thisSum > maxSum)rn rn maxSum = thisSum;rn rn rn return maxSum;rn rnrnrnint main(int argc, char* argv[])rnrn int a[] = -2, 11, -4, 13, -5, -2;rn vector lvec(a, a + sizeof(a)/sizeof(int));rn printf("maxSubSum1(lvec)):%d\n", maxSubSum(lvec));rnrn return 0;rn[/code]
求Oracle存储过程资料(电子书什么的)。。。。。
我的邮箱是myzone0312@163.com 我在网上下载了一个大概有29M左右的,如果是这个就不用了,大家帮忙啊,谢谢啦。。。。。。。
求处理Null值?
SQL2000中:rnselect sum(danjufeishu) as danshu from accession where xianwei=‘0101’rn当danshu返回值为null是怎么样将他变为零?
Element if = null; 求解答.
我要在在java里面生成XML,if是一个标签。rn 我怎么把if当成一个别名? 谢谢rnrn如:rnElement if = null;
java.lang.NumberFormatException: null 求大神!!
教师公寓与教师的关系 程序是想通过教师公寓的id获取teacher这个集合 比如几号公寓住着哪些教师 一直报转换类型错误 求大神看看nnnservice里面的代码nnn public static List findTeacher(int id)n List teacher = new ArrayList();n SqlSession session =MyBatisUtils.getSqlSession();n tryn TeacherApartmentDaoMapper teacherapartmentMapper = session.getMapper(TeacherApartmentDaoMapper.class);n teacher = teacherapartmentMapper.findTeacher(id);n n catch(Exception e)n e.printStackTrace();n n finallyn MyBatisUtils.closeSqlSession(session);n n n return teacher;n n n n nAction里面的代码nn @Action(value="findTeacher")n public void findTeacher()throws Exceptionn ServletActionContext.getResponse().setCharacterEncoding("utf-8");n List teacher = TeacherApartmentService.findTeacher((Integer.parseInt(ServletActionContext.getRequest().getParameter("ftId"))));// 这里报错n ServletActionContext.getResponse().getWriter()n .print(new Gson().toJson(teacher));n ServletActionContext.getResponse().getWriter().flush();n ServletActionContext.getResponse().getWriter().close();n n请问应该怎么改,这种1对多的关系做起卡了几天了 求大神指教 感激不尽!!nn控制台报的错是java.lang.NumberFormatException: null
难题?着急解决得说
各位大虾:rn小弟最近正在开发一款手机联网的软件rn需要对xml文档进行解析rnrn当然rn开发过程主要是在模拟器(motoV500)上面试验rn再到手机(motov501)上面运行rnrn可最近rn小弟对xml文件做了一点点改动rn就多加了一层嵌套rn可是rn却出现了一项不到的问题rnrn模拟器上能跑rn可是手机上却提示“应用程序错误”rnrn这个问题已经令小弟抓狂rnrn哪位大虾能出手相助,小弟感激不尽rnrnrn
连接SQLServer2k说用户(null)登陆失败?
错误信息:用户 '(null)' 登录失败。原因: 未与信任 SQL Server 连接相关联。rn连接字符串:rnstring strCon = "server=202.XXX.XXX.XXX;User ID=Test; Password=test; initial catalog=tempdb;"rn +"database=tempdb;trusted_connection=yes;connect timeout=30";rn
50分 求xsql的文档 求大家帮帮忙 没有文档 说说是作什么的也可以呀!!
没有文档 说说是作什么的也可以呀!!rnrn没有相关知识 求学习
catch(Expection e)中的e是什么意思,请详细的说拜托了!
我经常看到catch(Expection e)中的这e书上又没说rn大家说说catch(Expection e)中的e是什么意思,请详细的说拜托了!
解决安卓SAX乱码
public static String getStringByUrl(String getUrl) { // String getUrl = StringBuffer sb = new StringBuffer(); InputStreamReader isr = null; BufferedReader br = null; try { URL url = new...
解决Zbar 安卓中文乱码
安卓zbar中文乱码问题很少人解决,网上大部分都是ios的,http://www.cnblogs.com/geweb/archive/2013/02/28/geweb.html,本人也搞了好久,本so库参照ios对默认的西欧编码修改。 对官方文件主要修改: 1.修改了Android.mk文件,对libiconv.so不在编译,直接引用libiconv.so库,用户如果自己编译需要修改编译路径。 2.修改zbar\qrcode\qrdectxt.c文件,参考http://www.cnblogs.com/geweb/archive/2013/02/28/geweb.html 3.修改了iconv.h文件,以适应windows的编译。
安卓压缩图片(解决OOM)
public Bitmap getimage(String srcPath) { BitmapFactory.Options newOpts = new BitmapFactory.Options(); // 开始读入图片,此时把options.inJustDecodeBounds 设回true了 newOpts.inJustDecodeBounds = true; Bitmap
安卓内存问题---解决内存溢出
最近几天,发现APP OOM了,惊出一身冷汗有没有。。。 网上一查,studio可以检查内存,果断走起 运行APP,切换界面,发现APP内存不断上涨。泄露有木有。要加班的节奏啊 新版的studio,确实很强大,可以检测内存泄露问题, 步骤: 概念:内存泄露就是说:退出界面,本该通过GC回收的,因为存在某种引用而不能回收。运行studio会发现,当切换某个界面的时候,内存不会降到原