我创造了一个onTouchListener.不幸的是onTouch()方法throws我警告:
Run Code Online (Sandbox Code Playgroud)com/calculator/activitys/Calculator$1#onTouch should call View#performClick when a click is detected
这是什么意思?我没有找到有关此警告的任何信息.这是完整的代码:
LinearLayout llCalculatorContent = (LinearLayout) fragmentView.findViewById(R.id.calculator_content);
llCalculatorContent.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
Tools.hideKeyboard(getActivity(), getView());
getView().clearFocus();
return false;
}
});
Run Code Online (Sandbox Code Playgroud) 我有一个ArrayList我在之间传递activities.在这里ArrayList,由一个class有四个变量的对象组成.其中的一个变量是另一种ArrayList<object>是从另一个class.
我已经实现Parcelable上都和我敢肯定我已经正确地完成了parcelable方法.以下是错误:
错误:
03-18 02:37:27.063: D/dalvikvm(3249): GC_FOR_ALLOC freed 82K, 6% free 3020K/3180K, paused 1ms, total 3ms
03-18 02:37:27.093: I/dalvikvm-heap(3249): Grow heap (frag case) to 3.626MB for 635808-byte allocation
03-18 02:37:27.103: D/dalvikvm(3249): GC_FOR_ALLOC freed 5K, 5% free 3635K/3804K, paused 10ms, total 10ms
03-18 02:37:27.173: D/(3249): HostConnection::get() New Host Connection established 0xb96396c0, tid 3249
03-18 02:37:27.243: W/EGL_emulation(3249): eglSurfaceAttrib not implemented
03-18 02:37:27.253: D/OpenGLRenderer(3249): Enabling debug mode 0
03-18 …Run Code Online (Sandbox Code Playgroud) 我正在使用Facebook SDK在墙上发布消息.
现在我需要获取Facebook好友列表.任何人都可以帮我吗?
- 编辑 -
try {
Facebook mFacebook = new Facebook(Constants.FB_APP_ID);
AsyncFacebookRunner mAsyncRunner = new AsyncFacebookRunner(mFacebook);
Bundle bundle = new Bundle();
bundle.putString("fields", "birthday");
mFacebook.request("me/friends", bundle);
} catch(Exception e){
Log.e(Constants.LOGTAG, " " + CLASSTAG + " Exception = "+e.getMessage());
}
Run Code Online (Sandbox Code Playgroud)
当我执行我的时候activity,我没有看到任何东西,但是LogCat有一个调试消息,如:
06-04 17:43:13.863: DEBUG/Facebook-Util(409): GET URL: https://graph.facebook.com/me/friends?format=json&fields=birthday
Run Code Online (Sandbox Code Playgroud)
当我尝试直接从浏览器访问此URL时,我收到以下错误响应:
{
error: {
type: "OAuthException"
message: "An active access token must be used to query information about the current user."
}
}
Run Code Online (Sandbox Code Playgroud) 在iOS 7.1发布之前,我的应用程序没有任何崩溃.现在任何removeFromSuperview方法,崩溃.例如:我有视图控制器,当我想删除一个视图控制器时,我删除它的所有子视图,然后从堆栈中删除(堆栈:我在此存储视图控制器,用于加载新内容,并加载以前的内容):
for (UIView *subView in [contentVc subviews])
[subView removeFromSuperview];
Run Code Online (Sandbox Code Playgroud)
我得到了
- [CALayer retain]:发送到解除分配实例的消息
信息
[actual removeFromParentViewController];
Run Code Online (Sandbox Code Playgroud)
是一个删除它的好方法?它会释放整个视图控制器及其子视图吗?因为而不是removeFromSuperview,我的应用程序不会崩溃.我不明白iOS 7.1中有什么变化.
我怎样才能删除所有子视图中viewController没有removeFromSuperview,没有删除我的ViewController(如果我只是想添加新的子视图,并删除当前内容)?
更新:
有时崩溃:
[myactualviewcontroller.view removeFromSuperview];
Run Code Online (Sandbox Code Playgroud)
- [CALayer retain]:发送到解除分配实例的消息
为什么???
有时如果我尝试从视图控制器视图中删除主子视图,它会发生同样的崩溃:
[mainView removeFromSuperview] (mainView是单个UIView,添加到vc.view)
更新2 :(详细)
所以,我有一个容器视图.我正在UIViewController.view为这个容器添加一个.我正在添加一个视图作为子视图UIViewController.view.这个视图不是本地uiview,我的意思是,它声明为implementation{ UIView* mainView }.当我的UIViewController将被解除分配时,在它- (void) dealloc { [mainView removeFromSuperview]; [mainView release] [super dealloc];}
的主视图removeFromSuperview我的应用程序崩溃.
我需要创建像滚动TextView内部ScrollView..像1主要ScrollView内部可滚动TextView我已经把这个代码RelativeLayout
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_below="@+id/img_view_flag"
android:layout_marginTop="17dp"
android:paddingBottom="20dip">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/tv_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/rel_layout"
android:layout_marginTop="15dp"
android:maxLines="7"
android:scrollbars="vertical"
android:text="Medium Text"
android:paddingBottom="10dip"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/black" />
<RelativeLayout
android:id="@+id/rel_layout2"
android:layout_width="match_parent"
android:layout_height="4dp"
android:layout_alignParentLeft="true"
android:layout_below="@+id/tv_desc"
android:background="@color/black" >
</RelativeLayout>
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/rel_layout2"
android:layout_marginTop="24dp"
android:maxLines="5"
android:scrollbars="vertical"
android:text="Small Text"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/black" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/rel_layout2"
android:layout_centerHorizontal="true"
android:text="Title"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/black" />
<RelativeLayout
android:id="@+id/rel_layout3"
android:layout_width="match_parent"
android:layout_height="4dp"
android:layout_alignParentLeft="true"
android:layout_below="@+id/tv_title"
android:background="@color/black" >
</RelativeLayout> …Run Code Online (Sandbox Code Playgroud) 我有一个Activity使用Android NavigationDrawer.当只使用fragments(像往常一样)时,一切都很完美.但现在我想drawer在我的应用程序的其他活动中使用它,对于其中一些,我不希望主视图是一个fragment.
问
的问题是,在onTouchEvent()对的activity本身(和onItemClickedListener()一个孩子的ListView这个问题)不叫,因为drawer消费它.当然,我希望它被称为:)
不用说,我希望答案很简单(甚至是XML),并希望不是通过扩展Drawer类(除非那是当然需要的).
更多信息
Activity的主要布局非常简单,基本上是a ListView和DrawerLayout它的顶部(在XML下面).
该Drawer有一个fragment,因为它是childView(对片段导航),当然,在ListView该Drawer项目.
我已经看到很多关于(不完全)类似问题的问题,而且常见的答案是在抽屉上使用onInterceptTouch(),requestDisallowInterceptTouchEvent()在DrawerLayout父视图(Activity的主要内容)和甚至onTouchEvent()(返回False)上ListView.
似乎没有什么可以做到的.
我读了这个链接
,似乎在某处使用拦截方法可能就是答案.但是怎么样?
如果您需要任何代码,请告诉我.但这是一个非常基本的代码/布局.
谢谢!
我要求从FTP服务器下载图像到Android设备.我使用ftp4j-1.7.2.jar库尝试了几个样本,但无法连接FTP服务器并搞砸了.
有没有人使用过FTP服务器?
请建议从服务器连接和下载文件.
我过去几天在Ffmpeg工作,但无法获得任何有价值的输出.之后我按照下面的教程: -
http://www.roman10.net/how-to-build-ffmpeg-with-ndk-r9/
根据该教程.完成后,您应该能够找到
$NDK/sources/ffmpeg-2.0.1/android包含文件夹arm/lib和arm/include文件夹的文件夹.但我没有得到构建输出$NDK/sources/ffmpeg-2.0.1/android.请有人帮帮我.
谢谢.
我试着xml_layoutA加入xml_layoutB.
起初我不知道我必须添加<merge>标签xml_layoutA.
但后来我加了这个标签,然后xml_layoutA开始对齐到左,而不是到右像以前一样.
是什么导致了这种变化?
xml_layoutA.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tooltip_layout"
android:layout_width="262dp"
android:layout_height="92dp"
android:background="@drawable/tip_tool_top_right"
android:orientation="horizontal"
android:paddingTop="10dp"
android:paddingBottom="15dp"
android:paddingLeft="5dp"
android:paddingRight="10dp" >
<LinearLayout
...
</LinearLayout>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
与
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout
android:id="@+id/tooltip_layout"
android:layout_width="262dp"
android:layout_height="92dp"
android:background="@drawable/tip_tool_top_right"
android:orientation="horizontal"
android:paddingTop="10dp"
android:paddingBottom="15dp"
android:paddingLeft="5dp"
android:paddingRight="10dp" >
<LinearLayout
...
</LinearLayout>
</LinearLayout>
</merge>
Run Code Online (Sandbox Code Playgroud)
两种情况都是一样的 xml_layoutB.xml
在RelativeLayout:
<include
android:id="@+id/tooltipFriends"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@id/friendsonline_bar"
android:layout_alignParentRight="true"
android:visibility="visible"
layout="@layout/tooltip_friends" />
Run Code Online (Sandbox Code Playgroud) 我正在使用,Expandable ListView并且其中的数据是通过Sqlite数据库填充的。我提供了一个删除组的选项ExpandableListView,它实际上删除row了数据库中的各个组。但是活动不会刷新,并且删除的“案例”是可见的,直到返回并再次涉及到此案例为止activity。
我创建了一个class说extends *BaseExpandableListAdapter*。它包含所有overridden方法。以下是代码:
public class ExpandableListAdapterForRunning extends BaseExpandableListAdapter {
private Context _context;
private List<String> _listDataHeader; // header titles
public static List<String> _listDate;
public int index;
// child data in format of header title, child title
private HashMap<String, List<String>> _listDataChild;
public ExpandableListAdapterForRunning(Context context, List<String> listDataHeader,
HashMap<String, List<String>> listChildData,int i,List<String> listDate) {
this._context = context;
this._listDataHeader = listDataHeader;
this._listDataChild = listChildData;
this.index=i;
this._listDate=listDate;
} …Run Code Online (Sandbox Code Playgroud) android ×9
arraylist ×1
facebook ×1
ffmpeg ×1
ftp ×1
ios ×1
ios7.1 ×1
java ×1
layout ×1
objective-c ×1
parcelable ×1
scroll ×1
scrollview ×1
subview ×1
textview ×1