android SDK23 一些api无法使用的解决方案

1.Call requires API level 16 (current min is 11): android.app.Notification.Builder#build

Notification noti = new Notification.Builder(mContext)
         .setContentTitle("New mail from " + sender.toString())
         .setContentText(subject) 
         .setSmallIcon(R.drawable.new_mail)
         .setLargeIcon(aBitmap) 
         .build(); 

How exactly to use Notification.Builder
Call requires API level 16 (current min is 14): android.app.Notification.Builder#build
setLatestEventInfo cannot be resolved

2.api 23 FloatMath Method FloatMath.sqrt() not found

(float)Math.sqrt(...)

http://stackoverflow.com/questions/32065160/method-floatmath-sqrt-not-found

3.HttpClient won’t import in Android Studio

HttpClient is not supported any more in sdk 23. You have to use URLConnection or downgrade to sdk 22 (compile 'com.android.support:appcompat-v7:22.2.0')

If you need sdk 23, add this to your gradle:

android {
    useLibrary 'org.apache.http.legacy'
}
You also may try to download and include HttpClient jar directly into your project or use OkHttp instead

http://stackoverflow.com/questions/32153318/httpclient-wont-import-in-android-studio

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值