草庐IT

wp_customer_say

全部标签

安卓 : Crouton lib and custom font

我在我的应用程序中使用自定义字体,所以我想要一个用于面包丁的自定义字体。我已经尝试使用setTextAppearance来完成它,但它不起作用。在样式类中:INFOCUSTOM=newBuilder().setDuration(3000).setTextAppearance(R.id.crouton).build();然后,我尝试通过用我的字体更改setTypeface()来做到这一点,但它不起作用。在Crouton类中:privateTextViewinitializeTextView(finalResourcesresources){TextViewtext=newTextView

android - 何时在 android 原生框架 (AOSP) 中使用弱指针 (wp)

我知道SP和WP的区别,SP会自动回收动态分配的内存。但我不知道WP什么时候用,怎么用?谁能给我举个例子? 最佳答案 您必须知道使用SP会增加对象的引用计数,而使用WP则不会。所以WP只是地址的存储,它不能用于访问对象的字段,除非你提升它。但是如果对象已经被释放,wp.promote()将返回一个NULL指针。所以,WP将主要用于你想拥有一个内存对象的引用缓存但又不想持有它的场景。您每次都通过提升您的WP来访问数据,如果该对象不再可用,您需要(请求其他代码)重新创建它。 关于androi

安卓.view.InflateException : on writing a custom imageView

我有一个自定义的ImageView类,如下所示publicclassMyImageViewextendsImageView{publicMyImageView(Contextcontext){super(context);//TODOAuto-generatedconstructorstub}@OverrideprotectedvoidonDraw(Canvascanvas){//TODOAuto-generatedmethodstubPaintp=newPaint(Paint.ANTI_ALIAS_FLAG);canvas.drawLine(0,0,20,20,p);super.on

java - ArrayList<custom-object> 的 Parcelable 实现

我认为这只是一个愚蠢的错误,但ArrayList总是以null结尾。这让我发疯所以我想寻求帮助。项目等级:importandroid.os.Parcel;importandroid.os.Parcelable;publicclassStoryTagimplementsParcelable{privateStringtagTitle;privateintoccurrence;publicStoryTag(){}publicStoryTag(Parcelin){tagTitle=in.readString();occurrence=in.readInt();}publicStringget

android - 将自定义 ant 任务添加到我的 Android 项目中的 custom_rules.xml

我想为我的Android项目向Ant脚本添加一个任务,以便从源代码生成Javadoc。为此,我修改了custom_rules.xml归档为并将以下行添加到ant.properties:javadoc.dir=javadoc现在当我运行antjavadoc,我收到以下错误消息:$antjavadocBuildfile:e:\devel\src\java\bbct\android\common\test\build.xmlBUILDFAILEDe:\devel\src\java\bbct\android\common\test\build.xml:69:Thefollowingerroro

android - ListView : How to add data on custom ArrayAdapter?

为了拥有丰富多彩的ListView,我创建了自己的ArrayAdapter,但是当我想使用adapter.clear()或adapter.add()时,它会出现错误.这是代码和错误。XML文件:适配器:classstableArrayAdapterextendsArrayAdapter{HashMapmIdMap=newHashMap();publicstableArrayAdapter(Contextcontext,inttextViewResourceId,String[]objects){super(context,textViewResourceId,objects);for(

android - CalendarContract.EventsColumns.CUSTOM_APP_URI 的用途是什么?

标题说明了一切:CalendarContract.EventsColumns.CUSTOM_APP_URI的用途是什么?我问是因为我正在寻找一个地方,我的应用程序可以将一些特定于应用程序的数据填充到事件表中。也许这是一个无用的问题,因为当然,我需要确保其他应用程序不会破坏我的数据。也许更好的问题是:如何将特定于应用程序的数据存储在日历事件表中? 最佳答案 如CalendarContract中所述:/***ActivityAction:Displaytheeventtotheuserinthecustomappas*specified

android - 什么是CADisplayLink(iOS)或CompositionTarget(WP)的android相关

我需要每帧更新我的动画,在iOS上我有CADisplayLink,在WinPhone上我有CompositionTarget,但我该如何在Android上执行此操作?目前我正在使用Timer和Handler,但我相信有一种方法可以将回调与刷新率同步。 最佳答案 我知道的最直接的等价物是Choreographer(从API16开始)。看起来您的动画编写方式决定了同步它的最佳方式。Choreographer一般用处不大。如果您的动画是在AFAIK包含ViewPropertyAnimator的“动画框架”之外编写的,那么Choreogra

android - appcompat-v7 : Custom view not properly aligned in ActionBar

我正在尝试使用基于AppcompatToolbar的actionBar这是我的toolbar.xml我将其包含在我的activity.xml文件中。然后在我的Activity的OnCreate方法中,我将自定义PagerStrip设置为ActionBarActionBaractionBar=getSupportActionBar();actionBar.setCustomView(R.layout.pager_strip);actionBar.setDisplayShowCustomEnabled(true);tabs=(PagerSlidingTabStrip)actionBar.g

android - 功能自定义标题 : Cannot combine custom titles on API 11 and above

我有一个项目,我设置了:minSdkversion设置为10MainActivity是一个TabActivityonCreate方法中的代码是这样的:super.onCreate(savedInstanceState);requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);setContentView(R.layout.main);getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE,R.layout.custom_title);...使用之前的设置,一切正常!但是,如果我将minSdk