凡来处理是常见的详细列表项的CAB行动? [英] Where to handle CAB actions of a list item that are common with detail?

查看:213
本文介绍了凡来处理是常见的详细列表项的CAB行动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以说我有使用片段主/从模式,因此像往常一样,细节片段将里面的手机上新的活动,在平板电脑上,这将是previous活动,列出片段中也在里面。旧的东西。

我有一些行动,在细节上执行,喜欢分享,这将是动作条的项目。旧的东西。

但现在,我想实现上下文动作条,或者对话框,它在我看来,并没有真正的事情,这将允许从列表中,右键分享。

我的问题是,我应该有一个共享code?我想避免重复。在我的头,它不能真正的回调,因为细节可以是双重活性内或其单一的活动中。它真的很混乱给我,我应该怎么做。

希望你得到它。谢谢!


解决方案

  

我应该有一个共享code?我想避免重复


隔空猜测,这些共享code是你的 ACTION_SEND 调用,因为这是code左右的只有半打线路,塔克在某处的静态方法,可以通过你的细节片段,并托管在较小的屏幕列表中的活动进行访问。

lets say I have master/detail pattern using fragments, so as usual, the detail fragment would be inside new activity on a phone and on a tablet it would be inside the previous activity that list fragment is in also. Old stuff.

I have some actions to perform on the detail, like share, it would be actionbar item. Old stuff.

But now, I want to implement Contextual ActionBar, or a dialog, it doesnt really matter in my opinion, that would allow sharing right from the list.

My question is, where should I have that sharing code? I want to avoid duplicates. In my head, it cant really be a callback because the detail can be inside the dual activity or inside its single activity. Its just really confusing to me how should I do this.

Hope you get it. Thanks!

解决方案

where should I have that sharing code? I want to avoid duplicates

Taking a guess that "that sharing code" is your ACTION_SEND invocation, since that is only a half-dozen lines of code or so, tuck that in a static method somewhere that can be accessed by your detail fragment and by the activity that is hosting the list on smaller screens.

这篇关于凡来处理是常见的详细列表项的CAB行动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆