任何人都可以帮助我如何通过发布时间显示视图...我正在创建一个Android应用程序,现在我想显示一个Dialog当用户lauch该应用程序3或4或5次要求评价App。很抱歉没有代码段。请不要告诉我使用RateThisApp库。顺便说一下,我也是新的安卓机器人。感谢...
答案 0 :(得分:0)
每次运行您的活动时,您都会在SharedPrererence
中加载并保存启动计数器,如果此计数等于5,则会显示对话框(例如AlertDialog
)
答案 1 :(得分:0)
您可以使用SharedPreferences
了解用户打开应用的次数,并使对话取决于3,4或5次
如果你想让它变得动态你应该连接到webservice并从imei或蓝牙mac地址等设备获取一些独特的东西来知道哪个设备运行应用程序多少次
答案 2 :(得分:0)
首先制作共享偏好
<form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post" id="form">
<div id="contact">Contact Info
<br><input type="text" name="fname" placeholder="First Name*" required>
<br><input type="text" name="lname" placeholder="Last Name*" required>
<br><input type="text" name="company" placeholder="Company">
<br><input type="email" name="email" placeholder="Email Address*" required>
</div><br>
<div id="Specifics">Specifics
<div id="location">Location
<br><input type="radio" name="pages" id="page1" value="2" required><label for="page1"> /page1</label>
<br><input type="radio" name="pages" id="page2" value="1.5"><label for="page2"> /page2</label>
<br><input type="radio" name="pages" id="page3" value="1.5"><label for="page3"> /page3</label>
<br><input type="radio" name="pages" id="page4" value="1.5"><label for="page4"> /page4</label>
<br><input type="radio" name="pages" id="page5" value="1"><label for="page5"> /page5</label>
<br><input type="radio" name="pages" id="page6" value="1"><label for="page6"> /page6</label>
</div><br>
<div id="topbtm">Top or Bottom?
<br><input type="radio" name="location" id="tb_top" required><label for="tb_top">Top</label>
<br><input type="radio" name="location" id="tb_btm"><label for="tb_btm">Bottom</label>
</div><br>
<div id="selection">Selection
<br><label><input type="checkbox" name="selection" id="s1" value="4"><span>1</span></label>
<label><input type="checkbox" name="selection" id="s2" value="4"><span>2</span></label>
<label><input type="checkbox" name="selection" id="s3" value="4"><span>3</span></label>
<label><input type="checkbox" name="selection" id="s4" value="4"><span>4</span></label>
<label><input type="checkbox" name="selection" id="s5" value="4"><span>5</span></label>
<label><input type="checkbox" name="selection" id="s6" value="4"><span>6</span></label>
<br><label><input type="checkbox" name="selection" id="s7" value="4"><span>7</span></label>
<label><input type="checkbox" name="selection" id="s8" value="4"><span>8</span></label>
<label><input type="checkbox" name="selection" id="s9" value="4"><span>9</span></label>
<label><input type="checkbox" name="selection" id="s10" value="4"><span>10</span></label>
<label><input type="checkbox" name="selection" id="s11" value="4"><span>11</span></label>
<label><input type="checkbox" name="selection" id="s12" value="4"><span>12</span></label>
</div><br>
<div id="weeks">Weeks
<br><select required><option value="" disabled selected>Select one</option><option value="7">1 week</option><option value="14">2 weeks</option><option value="21">3 weeks</option><option value="28">4 weeks</option></select>
</div>
</div><br>
<div id="info">Info
<br><input type="file" name="image" value="image" accept="image/jpg" required>
<br><input type="url" name="url" placeholder="Linked Website (URL)" required>
<br><input type="text" name="color" placeholder="Background Color" required>
<br><input type="text" name="hovertext" placeholder="Hover Text">
</div><br>
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="business" value="(myemail)" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="item_name" value="Purchase" />
<input type="hidden" name="amount" id="total" value=""/>
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!" />
</form>
获取编辑
SharedPreferences shardepreferences = context.getSharedPreferences("YOUR_KEY_NAME", Context.MODE_PRIVATE);
现在你可以把String,Boolean,int,long和...放在下面的代码中
SharedPreferences.Editor editor = shardepreferences.edit();
key是String,值取决于放置的内容 并获得你可以做的值
editor.putLong(key, value);
if (editor.commit()) {
//Saved Successfully
} else {
//Does not save
}
如果未找到存储的首选项,则0将返回
你可以用你的号码改变0