自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(65)
  • 收藏
  • 关注

原创 更新Android Studio 3.6.1后。。。

Android Studio更新

2022-06-15 19:51:05 458

原创 Android错误:You need to use a Theme.AppCompat theme (or descendant) with this activity.

上午测试出一个程序崩溃的问题,错误提示:该Activity继承了AppCompatActivity,但我在清单文件中注册Activity的时候,theme没有用与之对应的AppCompat的theme,因此出现了错误。解决方法:1.如果没有特殊需要,定义的Activity继承Activity类就可以了2.将清单文件中该Activity的theme改为AppCompat的them

2017-10-17 09:39:17 1799

原创 android自定义Application类类型转换异常错误

自定义一个Application类,然后在activity类中通过getApplication()获得一个Application的实例:myApp = (MyApp) getApplication();但是运行程序的时候一直报类类型转换异常,原因是自定义的Application必须在清单文件中注册声明即:<application android:name="co

2017-09-27 15:12:51 669

原创 Visual Studio 2013 C#快捷键

F10:逐过程调试F11:逐语句调试F12:转到定义,到变量或函数定义的地方Ctrl + [:匹配选中的括号(大括号、小括号都行)Ctrl + Space:代码补全Ctrl + Tab:在VS中切换打开的窗口,即切换各个文件Ctrl + L:递增搜索,与Ctrl + F不同的是搜索期间不显示搜索对话框,且Ctrl + F搜索下一个按Ctrl + L或F3,Escape退出,

2017-09-13 16:59:36 434

原创 线程间操作无效: 从不是创建控件“xx”的线程访问它。

用C#写串口通信的时候遇到一个问题,奇怪的是我并没有用线程。其中receive是存放接收数据的文本框。我直接将接收到的数据存放到receive这个文本框里,然后就报出了这个错误。private void Com_DataReceived(object sender, SerialDataReceivedEventArgs e) {

2017-09-11 11:15:41 1025

原创 使用PullToRefresh遇到的问题

1.上拉或者下拉之后一直加载我以前使用PullToRefresh时并没有遇到这个问题,也是找了好长时间才找到原因。PullToRefresh框架必须使用异步任务来加载数据,如果在onRefresh()方法中没有使用异步任务,直接加载数据或者填充数据,PullToRefresh就会一直处于刷新状态。这也解释了为什么我以前用PullToRefresh时没有遇到这个问题,因为以前使用了异步任

2017-09-02 14:21:01 919

原创 Android实现左右滑动切换的效果

Android 2.0以后Activity中增加了一个方法overridePendingTransition (int enterAnim, int exitAnim),enterAnim是要进入屏幕的动画,exitAnim是要退出屏幕的动画,需要注意的是这个方法必须放在startActivity()或者finish()后面。 原理:以手机下边为x轴,要实现往左滑动的切换效果,需要让要退出的a

2017-05-03 11:14:57 3927

原创 Android Studio 2.2+签名打包后,应用显示未安装

安装了2.3.1版本的Android Studio之后,按照原来的方式将项目打包签名,安装到手机上,提示应用未安装,这是因为Android Studio 2.2以后的版本重写了签名机制,因此使用以前的签名打包方法会出现应用无法安装的问题。解决方法:1.File-Project Structure,选择module,在Signing添加config2.Build Types-releas

2017-04-27 14:28:10 1652

原创 使用Fiddler抓取在夜神模拟器安装的软件的包

一、设置Fiddler代理1.点击Tools-Fiddler Options进入Fiddler Options页面2.点击Connections,将Fiddler listens on port设为8888,勾选Allow remote computers to connect3.点击OK,代理设置完成,重启Fiddler配置生效。二、设置夜神模拟器代理1.点击设置,进入到wi

2017-04-22 11:20:43 20172

原创 使用equals方法判断String字符串是否为空时报空指针错误

错误:(Attempt to invoke virtual method 'booleanjava.lang.String.equals(java.lang.Object)' on a null object reference)代码:String ss = bean.getName();   if(!ss.equals("")){   }解决方案:将equals左右的值对

2017-03-04 10:18:55 8210

原创 Android程序不在后台列表中显示

使apk不在后台列表中显示,其实实现起来非常简单,只需要在清单文件中的某一个activity中添加两行代码即可。android:excludeFromRecents="true"android:launchMode="singleInstance"android:excludeFromRecents="true"可以让程序不在后台列表中显示android:launchMode="s

2017-02-10 17:44:10 3432

原创 关于.9图片的总结

.9图片报错Crunching Cruncher .9.png failed,see logs

2016-12-31 13:35:10 691

原创 ipa提取png图片,windows下显示黑色

项目的图片是跟公司做iOS的同事要的,有一些显示为黑色。这是因为ipa提取的png图片经过了xcode格式处理,所以在windows下查看会显示黑色。查了大神的博客,找到了解决办法。1)需要下载一个工具:iOSPngConverter.exe。2)打开iOSPngConverter.exe,点击file->Batch Conversion。3)选择路径,点击OK。这样就可以了。

2016-12-30 11:19:36 1935

原创 Android Studio无法连接夜神模拟器

解决方法:1)进入CMD,转到夜神安装目录        2)执行命令:nox_adb.exe connect 127.0.0.1:62001,连接到服务器。例如:夜神安装目录是D:\Users\Administrator.USER-20161125KP\AppData\Roaming\Nox\bin,在命令行中输入cd\,回车,输入d:,回车,输入cd 夜神安装目录,

2016-12-28 11:16:53 6726 1

原创 透明度无法设置

做项目时遇到一个问题,需求是这样的:长按ListView的item弹出一个PopupWindow,类似于微信的效果,背景是半透明的。但是明明设置了透明度,弹出框没实现半透明的效果。搜了各种博客,尝试了各种方法,都没能解决问题。后来发现是没有设置背景。。。layout.setBackgroundDrawable(this.getResources().getDrawable(R.drawable

2016-12-27 17:52:42 694

原创 窗口泄露问题

昨天遇到一个问题:android.view.WindowManager$BadTokenException: Unable to add window -- token android.app.LocalActivityManager$LocalActivityRecord@45f48c40 is not valid; is your activity running?意思就是发生了窗体泄露,也就

2016-12-27 12:13:50 852

转载 干货

写给新入职的毕业生们http://bbs.jointforce.com/topic/19672(出处: 解放号论坛)

2016-08-31 17:14:45 337

原创 获取单选按钮方法不对导致程序闪退

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_p

2016-08-27 17:46:19 1305 1

原创 POJ 2392 Space Elevator

Space ElevatorTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 8783 Accepted: 4173DescriptionThe cows are going to space! They plan to achieve orbit by b

2015-02-05 11:31:47 326

原创 POJ 2184 Cow Exhibition

Cow ExhibitionTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 9573 Accepted: 3698Description"Fat and docile, big and dumb, they look so stupid, they are

2015-02-05 10:39:00 334

原创 POJ 2063 Investment

InvestmentTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 8857 Accepted: 3039DescriptionJohn never knew he had a grand-uncle, until he received the nota

2015-02-05 09:59:44 311

原创 POJ 1276 Cash Machine

Cash MachineTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 28509 Accepted: 10174DescriptionA Bank plans to install a machine for cash withdrawal. The m

2015-02-05 09:41:28 269

原创 POJ 1837 Balance

BalanceTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 11138 Accepted: 6917DescriptionGigel has a strange "balance" and he wants to poise it. Actually,

2015-02-05 09:26:22 272

转载 背包九讲

转自:dd_engi 的背包九讲目录第一讲 01背包问题第二讲 完全背包问题第三讲 多重背包问题第四讲 混合三种背包问题第五讲 二维费用的背包问题第六讲 分组的背包问题第七讲 有依赖的背包问题第八讲 泛化物品第九讲 背包问题问法的变化附:USACO中的背包问题前言本篇文章

2015-02-04 20:10:02 289

转载 POJ 1062 昂贵的聘礼

昂贵的聘礼Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 38272 Accepted: 11046Description年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给

2015-02-02 19:53:59 289

原创 POJ 2240 Arbitrage

ArbitrageTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 16457 Accepted: 6926DescriptionArbitrage is the use of discrepancies in currency exchange rates

2015-02-02 19:34:43 249

原创 POJ 1125 Stockbroker Grapevine

Stockbroker GrapevineTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 28076 Accepted: 15576DescriptionStockbrokers are known to overreact to rumours. You

2015-02-02 19:18:59 266

原创 POJ 2253 Frogger

FroggerTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 27295 Accepted: 8871DescriptionFreddy Frog is sitting on a stone in the middle of a lake. Suddenl

2015-02-02 17:13:44 274

原创 POJ 3259 Wormholes

WormholesTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 32555 Accepted: 11831DescriptionWhile exploring his many farms, Farmer John has discovered a nu

2015-01-30 21:41:13 257

原创 POJ 1860 Currency Exchange

Currency ExchangeTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 21129 Accepted: 7575DescriptionSeveral currency exchange points are working in our city

2015-01-30 20:18:41 245

原创 POJ 2458 Highways

HighwaysTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 23268 Accepted: 10729DescriptionThe island nation of Flatopia is perfectly flat. Unfortunately,

2015-01-29 20:36:14 352

原创 POJ 1258 Agri-Net

Agri-NetTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 41919 Accepted: 17095DescriptionFarmer John has been elected mayor of his town! One of his campa

2015-01-29 20:28:14 256

原创 POJ 3026 Borg Maze

Borg MazeTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 9073 Accepted: 3020DescriptionThe Borg is an immensely powerful race of enhanced humanoids from

2015-01-29 20:07:59 298

原创 POJ 2251 Dungeon Master

Dungeon MasterTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 17690 Accepted: 6880DescriptionYou are trapped in a 3D dungeon and need to find the quicke

2015-01-27 21:23:53 260

原创 POJ 3083 Children of the Candy Corn

Children of the Candy CornTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 10233 Accepted: 4432DescriptionThe cornfield maze is a popular Halloween treat

2015-01-27 20:55:01 237

原创 POJ 3009 Curling 2.0

Curling 2.0Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 12556 Accepted: 5291DescriptionOn Planet MM-21, after their Olympic games this year, curling

2015-01-27 20:37:43 280

原创 POJ 1442 Black Box

Black BoxTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 8052 Accepted: 3297DescriptionOur Black Box represents a primitive database. It can save an int

2015-01-27 20:06:38 374

原创 OJ 1510Contest02-4 Spiral

Contest02-4 SpiralTime Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^题目描述Given an odd number n, we can arrange integers from 1 to n*n in the shape of a spiral. The Figure 1 b

2015-01-26 21:14:11 284

原创 OJ 1508

Contest02-2 CoverTime Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^题目描述Tom wants to cover a rectangular floor by indentical L-shape tiles without overlap. As shown below, th

2015-01-26 21:05:36 347

原创 POJ 3126 Prime Path

Prime PathTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 12111 Accepted: 6876DescriptionThe ministers of the cabinet were quite upset by the message fr

2015-01-26 20:54:52 257

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除