电面问题总结

2015.08.19:

Android相关

1. 在Fragment中启动另一个Activity,两种方法startActivity() 和 getActivity().startActivity() 有什么不同?

http://stackoverflow.com/questions/19759668/difference-between-calling-getactivity-startactivity-and-startactivity-i

没有区别,在Fragment中直接调用startActivity(),查看源码中的这个方法,该方法会去调用Fragment所在的Activity中的startActivity()方法

Fragment中的相关源码如下:

    /**
     * Call {@link Activity#startActivity(Intent)} from the fragment's
     * containing Activity.
     *
     * @param intent The intent to start.
     */
    public void startActivity(Intent intent) {
        startActivity(intent, null);
    }

    /**
     * Call {@link Activity#startActivity(Intent, Bundle)} from the fragment's
     * containing Activity.
     *
     * @param intent The intent to start.
     * @param options Additional options for how the Activity should be started.
     * See {@link android.content.Context#startActivity(Intent, Bundle)
     * Context.startActivity(Intent, Bundle)} for more details.
     */
    public void startActivity(Intent intent, Bundle options) {
        if (mActivity == null) {
            throw new IllegalStateException("Fragment " + this + " not attached to Activity");
        }
        if (options != null) {
            mActivity.startActivityFromFragment(this, intent, -1, options);
        } else {
            // Note we want to go through this call for compatibility with
            // applications that may have overridden the method.
            mActivity.startActivityFromFragment(this, intent, -1);
        }
    }
其中的mActivity引用变量:

    // Activity this fragment is attached to.
    Activity mActivity;
2. 在fragment中startActivityForResult()之后回传的结果是在Fragment中还是在Activity中?

是在Fragment所attach的Activity中。

http://stackoverflow.com/questions/6147884/onactivityresult-not-being-called-in-fragment

3. Fragment哪个回调方法中可以getActivity()

onAttach()

4.图片加载优化

5.ListView优化

6.Http通信的一些第三方库可以使用:volley,okhttp等


2015.03.24:

1. Django接口, REST? Ajax?

2. 堆排序算法的大致思路

3. Range(0,10,2) 通过在第三个参数上进行设置,就可以产生偶数了

4. Linux一些命令,比如:ps,,kill,将进程放到后台去执行,在开机启动时就启动这个进程。

5. Python中,*? 实现贪婪匹配

2015.03.20:

1.MongoDB支不支持事务:不支持

2. 项目中 条目检索(搜索)的方法当数据量大的时候,怎么去改进

3.检索(搜索)时间是多少

4.建议用MongoDB来做检索资源的存储数据库

2015.03.19:

1. 线程安全:Spring中的Bean

http://www.cnblogs.com/doit8791/p/4093808.html

http://blog.csdn.net/xiaojianpitt/article/details/6650280

2. 怎么理解缓存

3. apache的一些概念




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值