chaychan / toutiao Goto Github PK
View Code? Open in Web Editor NEW精仿今日头条
精仿今日头条
播放视频都提示播放地址无效
你好
当直接加载url链接时 如果内容很长 会出现加载的H5内容显示不全的问题
非常棒的项目,希望尽快实现搜索界面
是抓包抓的吗?
这个是否也可以实现
7-31 15:28:41.671 25490-25490/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.chaychan.news, PID: 25490
java.lang.RuntimeException: Unable to instantiate application com.chaychan.news.app.MyApp: java.lang.ClassNotFoundException: Didn't find class "com.chaychan.news.app.MyApp" on path: DexPathList[[zip file "/data/app/com.chaychan.news-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.chaychan.news-1, /vendor/lib, /system/lib]]
at android.app.LoadedApk.makeApplication(LoadedApk.java:519)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4416)
at android.app.ActivityThread.access$1500(ActivityThread.java:143)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1269)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5120)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:818)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:634)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.chaychan.news.app.MyApp" on path: DexPathList[[zip file "/data/app/com.chaychan.news-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.chaychan.news-1, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
at android.app.Instrumentation.newApplication(Instrumentation.java:975)
at android.app.LoadedApk.makeApplication(LoadedApk.java:514)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4416)
at android.app.ActivityThread.access$1500(ActivityThread.java:143)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1269)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5120)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:818)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:634)
at dalvik.system.NativeStart.main(Native Method)
在公司里把你的apk拉下来看了看,不错啊,继续加油完成接下来的的模块
NewsAdapter: data----------->[]
java.lang.NullPointerException: Attempt to read from field 'java.lang.String com.chaychan.news.model.entity.ImageEntity.url' on a null object reference at com.chaychan.news.ui.adapter.NewsAdapter$1.getItemType(NewsAdapter.java:89)
at com.chaychan.news.ui.adapter.NewsAdapter$1.getItemType(NewsAdapter.java:78)
现在有其他问题,装好之后,提示网络不给力,没有新闻和视频等列表
很好的UI和框架,学习了。期待后续的完善,赞一个!
在fragment里面播放视频,不知道为什么jcvideoplayer_lib\JCVideoPlayer.java这个类的341行报.Activity.getWindow()' on a null object reference空指针.注掉就没问题 .activity没这个问题
右滑关闭Activity(SlideCloseLib)不适配8.0系统全面屏手机(华为手机),进入相关Activity会闪退
具体原因可以查看:https://www.jianshu.com/p/d0d907754603
大佬可否做一下适配
侧滑关闭界面时,style中添加 android:windowIsTranslucent = true 这个属性,就会导致关闭后出现1s的白屏,demo 中并没有这个问题,我也没有找到解决的方法,还请指点一下
从视频列表第一个依次往下播放,后面的视频会播放前面的视频,一直循环。
提示错误
[ (NewsListPresenter.java:48)#onError ] java.lang.IllegalStateException:## Expected an int but was BOOLEAN at line 1 column 1010 path $.has_m3u8_video
实体类对象数据类型错误
NullPointerException 发现个BUG ,比如当前选项在第二个,第三个页面从来没加载过的情况下,标签管理删除了第二个,APP就崩溃了...
主要是解析视频的接口改了规则,由于是使用别人的接口,所以只要他们接口改动,就获取不到视频解析地址,导致无法播放视频。最近由于比较忙,没能及时修复,现在利用假期时间,修复完成了。
java.lang.IllegalArgumentException: No view found for id 0x7f09012f (com.chaychan.news:id/vp_content) for fragment NewsListFragment{9f3fe9 #1 id=0x7f09012f android:switcher:2131230892:1}
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1454)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852)
at android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3269)
at android.support.v4.app.FragmentManagerImpl.dispatchStart(FragmentManager.java:3235)
at android.support.v4.app.Fragment.performStart(Fragment.java:2483)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1494)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852)
at android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3269)
at android.support.v4.app.FragmentManagerImpl.dispatchStart(FragmentManager.java:3235)
at android.support.v4.app.FragmentController.dispatchStart(FragmentController.java:212)
at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:628)
at com.chaychan.news.ui.activity.MainActivity.onStart(HomeActivity.java:152)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1391)
at android.app.Activity.performStart(Activity.java:7271)
at android.app.Activity.performRestart(Activity.java:7382)
at android.app.ActivityThread.handleWindowVisibility(ActivityThread.java:4591)
at android.app.servertransaction.WindowVisibilityItem.execute(WindowVisibilityItem.java:38)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:113)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:71)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2074)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:224)
at android.app.ActivityThread.main(ActivityThread.java:7113)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:928)
多次点击不同视频列表后,该异常随机出现,异常信息如下:
05-29 16:44:07.831 E/AndroidRuntime( 4294): Process: com.chaychan.news, PID: 4294
05-29 16:44:07.831 E/AndroidRuntime( 4294): java.lang.NullPointerException: Attempt to read from field 'java.util.LinkedHashMap cn.jzvd.JZDataSource.urlsMap' on a null object reference
05-29 16:44:07.831 E/AndroidRuntime( 4294): at cn.jzvd.JzvdStd.onClick(JzvdStd.java:266)
05-29 16:44:07.831 E/AndroidRuntime( 4294): at com.chaychan.news.utils.MyJZVideoPlayerStandard.onClick(MyJZVideoPlayerStandard.java:59)
05-29 16:44:07.831 E/AndroidRuntime( 4294): at android.view.View.performClick(View.java:7192)
05-29 16:44:07.831 E/AndroidRuntime( 4294): at android.view.View.performClickInternal(View.java:7166)
05-29 16:44:07.831 E/AndroidRuntime( 4294): at android.view.View.access$3500(View.java:824)
05-29 16:44:07.831 E/AndroidRuntime( 4294): at android.view.View$PerformClick.run(View.java:27592)
05-29 16:44:07.831 E/AndroidRuntime( 4294): at android.os.Handler.handleCallback(Handler.java:888)
05-29 16:44:07.831 E/AndroidRuntime( 4294): at android.os.Handler.dispatchMessage(Handler.java:100)
05-29 16:44:07.831 E/AndroidRuntime( 4294): at android.os.Looper.loop(Looper.java:213)
05-29 16:44:07.831 E/AndroidRuntime( 4294): at android.app.ActivityThread.main(ActivityThread.java:8169)
05-29 16:44:07.831 E/AndroidRuntime( 4294): at java.lang.reflect.Method.invoke(Native Method)
05-29 16:44:07.831 E/AndroidRuntime( 4294): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
05-29 16:44:07.831 E/AndroidRuntime( 4294): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
修复8月21号因今日头条接口数据更改的BUG,详情页新增查看和保存图片功能,查看图片支持缩放,可以保存图片到本地
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.chaychan.news, PID: 1979
java.lang.RuntimeException: Unable to instantiate application com.chaychan.news.app.MyApp: java.lang.ClassNotFoundException: Didn't find class "com.chaychan.news.app.MyApp" on path: DexPathList[[zip file "/data/app/com.chaychan.news-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.chaychan.news-1, /system/lib]]
at android.app.LoadedApk.makeApplication(LoadedApk.java:516)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4319)
at android.app.ActivityThread.access$1500(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5019)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.chaychan.news.app.MyApp" on path: DexPathList[[zip file "/data/app/com.chaychan.news-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.chaychan.news-1, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
at android.app.Instrumentation.newApplication(Instrumentation.java:992)
at android.app.LoadedApk.makeApplication(LoadedApk.java:511)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4319)
at android.app.ActivityThread.access$1500(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5019)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
我觉得不能播放有可能需要更换下JCVideo为JZViedo
但我改了半天也不知道还有哪儿没改完
java.lang.IllegalStateException
at android.media.MediaPlayer.getCurrentPosition(Native Method)
at com.chaychan.news.ui.activity.NewsDetailBaseActivity.postVideoEvent(NewsDetailBaseActivity.java:217)
at com.chaychan.news.ui.activity.VideoDetailActivity.onBackPressed(VideoDetailActivity.java:110)
at android.app.Activity.onKeyUp(Activity.java:2494)
at android.view.KeyEvent.dispatch(KeyEvent.java:2667)
at android.app.Activity.dispatchKeyEvent(Activity.java:2751)
at android.support.v7.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:541)
at android.support.v7.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:59)
at android.support.v7.app.AppCompatDelegateImplBase$AppCompatWindowCallbackBase.dispatchKeyEvent(AppCompatDelegateImplBase.java:319)
at com.android.internal.policy.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:2310)
at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4164)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4126)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3674)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3727)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3693)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3819)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3701)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3876)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3674)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3727)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3693)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3701)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3674)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3727)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3693)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3852)
at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:4018)
at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:2292)
at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:1913)
at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:1904)
at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:2269)
at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:141)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:323)
at android.os.Looper.loop(Looper.java:138)
at android.app.ActivityThread.main(ActivityThread.java:5528)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:740)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:630)
Response:{"retCode":300,"retDesc":"页面停留时间过长,请强制刷新当前页. :)","data":null,"succ":false}
地址访问就405 大神什么时候修复啊
可以适配一下androidx吗
1.今天发现拉取新闻列表的时候报错,排查后发现是json中某个属性由原本的int类型改成boolean类型;
2.接着发现视频播放不了,拉取视频数据报错,发现获取到的Json数据中没有视频的数据,经过抓包分析后发现今日头条的接口获取地址更新了,而且请求参数需要有iid这个请求参数才能获取到有视频数据的json,现在已经修复完毕。
3.如果再遇到获取新闻失败或者视频播放失败的原因,请不要灰心和失望,我会不断完善,希望大家可以相信和支持我。
打开build.gradle提示Gradle project sync failed. Basic functionality will not work properly
视频点击进去后,再退出,连续的这样操作几次,会出现崩溃的情况,必现。
应该是有内存泄漏的情况。
最新的今日头条 非视频详情页 底部有评论和转发两个按钮,点击可切换列表,整个布局的滑动十分流畅,想请教一下, 怎么实现
打开build,提示Gradle project sync failded. Basic functionality will not work properly. 怎么解决
修复视频无法播放的问题
你好,视频的封面是获取的视频帧还是传的图片?
TouTiao-master\app\src\main\res\common\layout\activity_main.xml
以下全爆红:
<com.chaychan.library.BottomBarItem
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
app:iconNormal="@mipmap/tab_home_normal"
app:iconSelected="@mipmap/tab_home_selected"
app:itemText="@string/tab_home"
app:itemTextSize="8sp"
app:textColorNormal="@color/color_515051"
app:textColorSelected="@color/color_D33D3C"
app:itemMarginTop="-5dp"
app:openTouchBg="true"
app:touchDrawable="@drawable/selector_bottom_tab"
/>
<com.chaychan.library.BottomBarItem
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
app:iconNormal="@mipmap/tab_video_normal"
app:iconSelected="@mipmap/tab_video_selected"
app:itemText="@string/tab_video"
app:itemTextSize="8sp"
app:textColorNormal="@color/color_515051"
app:textColorSelected="@color/color_D33D3C"
app:itemMarginTop="-5dp"
app:openTouchBg="true"
app:touchDrawable="@drawable/selector_bottom_tab"
/>
最近有不少朋友ISSUES我,说在安卓4.3或者4.4的模拟器或者真机运行,安装后一点就崩溃,我在真机和android7.0的模拟器上尝试后发现并没有这个问题,今天下午使用4.1.1的模拟器安装后发现出现了崩溃,重新clean项目编译后,可以运行了,现在重新更新了apk包,现在下载到的就不会出现那种崩溃的异常了,很感谢你们提出这个问题,谢谢。
希望作者有时间的话,能结合App的一些功能,做一些对应的教程
搜索框点击没有效果,不知道是不是功能漏了实现 2333
我装上app后清了一次缓存,现在就浏览不到数据了,还有一个小bug就是点击下方的视频按钮(连续点击),首页按钮也会跟着颜色变化
这个是因为抓包的地址失效么?
RT,点着特别费劲,点了之后也没什么反应,只有我一个人有这样的问题么?
视频无法播放 点击了没有反应
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.