我正在尝试编写一个活动,显示一个viewpager,其中包含一些图像和listview下面的一些数据..但我的问题是我只能在屏幕的最后一部分滚动列表视图我想让viewpager可以滚动listview所以我想把它作为标题..这是我的XMl文件
<TableLayout 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_parent"
tools:context=".MainActivity" >
<com.devsmart.android.ui.HorizontalListView
android:id="@+id/sectionsList"
android:layout_width="wrap_content"
android:layout_height="25dp"
android:background="@drawable/menu_bg" />
<include layout="@layout/main_screen_components" />
<ListView
android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
Run Code Online (Sandbox Code Playgroud)
我在课堂上写这篇文章
@Override
protected void onPostExecute(List<News> result) {
Utils.pagerNews(result);
Utils.listNews(result);
ImagePagerAdapter pAdapter = new ImagePagerAdapter(
appManager.getPagerNews());
pager.setAdapter(pAdapter);
View headerView = getLayoutInflater().inflate(R.layout.main_screen_components , null , false);
NewsListAdapter adapter = new NewsListAdapter(getBaseContext(),
appManager.getListNews());
listView.addHeaderView(headerView);
listView.setAdapter(adapter);
progress.dismiss();
}
Run Code Online (Sandbox Code Playgroud)
当我运行这个代码时,它给了我一个重复的分页器..修复了一个数据和一个空的一个作为我的listview的标题..当我删除其中包括我的寻呼机它崩溃当我尝试设置适配器到寻呼机. . 任何的想法 ?
每当我尝试从eclipse导入项目时,我都会收到错误
Error:Execution failed for task ':app:mergeDebugResources'.
Run Code Online (Sandbox Code Playgroud)
错误:无法运行命令:D:\ Android\sdk\build-tools\19.1.0\aapt.exe s -i C:\ projects\ZwallU\app\src\main\res\drawable-hdpi\filgoal.png -o C:\ projects\ZwallU\app\build\res\all\debug\drawable-hdpi\filgoal.png错误代码:42输出:libpng错误:不是PNG文件
在eclipse上使用这个文件没有任何问题..任何人都有这个错误的解决方案吗?
每次它都会给我“无法解码流 java.io.FileNotFoundException: /: open Faild EISDIR (Is a Directory)”
我如何才能摆脱这个错误..这个类在我完成的许多任务中运行良好!
这是我用来获取位图的类
private class ImageLoaderTask extends AsyncTask<HashMap<String, Object>, Void, HashMap<String, Object>>{
@Override
protected HashMap<String, Object> doInBackground(HashMap<String, Object>... hm) {
InputStream iStream=null;
String imgUrl = (String) hm[0].get("image");
int position = (Integer) hm[0].get("position");
URL url;
try {
url = new URL(imgUrl);
// Creating an http connection to communicate with url
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
// Connecting to url
urlConnection.connect();
// Reading data from url
iStream = urlConnection.getInputStream();
// Getting Caching directory
File …Run Code Online (Sandbox Code Playgroud) 所以我创建了一个片段活动,其中包含带有TabPageIndicator的Viewpager从片段滑动到另一个片段,并且在每个片段中我创建了一个ListView,其中包含一个ViewPager作为Header视图,问题是viewPager不刷卡即使我取消主ViewPager swipping
我用ActionBar标签尝试了同样的事情,但它也没有用
这是我的片段活动
public class SampleTabsStyled extends FragmentActivity {
private static final String[] CONTENT = new String[] { "Recent", "Artists",
"Albums", "Songs", "Playlists", "Genres" };
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.simple_tabs);
FragmentPagerAdapter adapter = new GoogleMusicAdapter(
getSupportFragmentManager());
final ViewPager pager = (ViewPager) findViewById(R.id.pager);
pager.setAdapter(adapter);
pager.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
// TODO Auto-generated method stub
switch (event.getAction()) {
case MotionEvent.ACTION_MOVE:
pager.requestDisallowInterceptTouchEvent(true);
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
pager.requestDisallowInterceptTouchEvent(false);
break;
}
return true;
} …Run Code Online (Sandbox Code Playgroud) android android-listview android-fragments android-viewpager
我想制作一个包含viewpager和listview的活动,你可以在它们之间滚动它们......就像这些应用程序......任何人都可以帮助

我正在尝试使用MediaProjection API记录屏幕。我想修剪媒体投影录制的视频。有没有不使用任何第三方依赖项的方法?
android mediamuxer android-mediaprojection android-mediacodec
我想创建一个小部件,其中有两个按钮来更改文本和小部件内的图像我的问题是我无法将服务中的所需位置发送到AppWidgetProvider类,在onRecieve之前调用onUpdate以便我无法获取我发送到appWidgetProvider的附加内容..这是我的代码...我想在onUpdate之前调用onReceive
public class Youm7widget extends AppWidgetProvider {
private int position = 0;
@Override
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
super.onReceive(context, intent);
Log.d("on recieve", "here");
position = intent.getIntExtra("position", 0);
}
@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager,
int[] appWidgetIds) {
// TODO Auto-generated method stub
Log.d("on update", "here");
ComponentName thisWidget = new ComponentName(context, Youm7widget.class);
int[] allWidgetIds = appWidgetManager.getAppWidgetIds(thisWidget);
// Build the intent to call the service
Intent intent = new Intent(context.getApplicationContext(),
WidgetConfiguration.class);
intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, allWidgetIds);
intent.putExtra("position", …Run Code Online (Sandbox Code Playgroud)